[Boost-bugs] [Boost C++ Libraries] #1626: [type_traits] "bad_alloc is not a member of std" in has_virtual_destructor_test.cpp

Subject: [Boost-bugs] [Boost C++ Libraries] #1626: [type_traits] "bad_alloc is not a member of std" in has_virtual_destructor_test.cpp
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2008-02-07 15:23:11


#1626: [type_traits] "bad_alloc is not a member of std" in
has_virtual_destructor_test.cpp
-------------------------------------+--------------------------------------
 Reporter: faridz_at_[hidden] | Owner: johnmaddock
     Type: Bugs | Status: new
Milestone: To Be Determined | Component: type_traits
  Version: Boost Development Trunk | Severity: Problem
 Keywords: |
-------------------------------------+--------------------------------------
 I've got the following errors while testing the boost with stdcxx library
 on icc-10.1/Linux:

 {{{
 ../libs/type_traits/test/has_virtual_destructor_test.cpp(58): error:
 namespace "std" has no member "bad_alloc"
 BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_virtual_destructor<std::bad_alloc>::value,
 true, false);
   ^

 ../libs/type_traits/test/has_virtual_destructor_test.cpp(58): error:
 namespace "std" has no member "bad_alloc"
 BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_virtual_destructor<std::bad_alloc>::value,
 true, false);
   ^

 ../libs/type_traits/test/has_virtual_destructor_test.cpp(58): error:
 namespace "std" has no member "bad_alloc"
 BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_virtual_destructor<std::bad_alloc>::value,
 true, false);
   ^

 ../libs/type_traits/test/has_virtual_destructor_test.cpp(58): error:
 namespace "std" has no member "bad_alloc"
 BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_virtual_destructor<std::bad_alloc>::value,
 true, false);
   ^

 ../libs/type_traits/test/has_virtual_destructor_test.cpp(58): error:
 namespace "std" has no member "bad_alloc"
 BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_virtual_destructor<std::bad_alloc>::value,
 true, false);
   ^

 ../libs/type_traits/test/has_virtual_destructor_test.cpp(58): error:
 namespace "std" has no member "bad_alloc"
 BOOST_CHECK_SOFT_INTEGRAL_CONSTANT(::tt::has_virtual_destructor<std::bad_alloc>::value,
 true, false);
   ^

 compilation aborted for
 ../libs/type_traits/test/has_virtual_destructor_test.cpp (code 2)
 }}}

 The same result on gcc/Linux:

 {{{
 ../libs/type_traits/test/has_virtual_destructor_test.cpp: In function
 ???int main()???:
 ../libs/type_traits/test/has_virtual_destructor_test.cpp:58: error:
 ???bad_alloc??? is not a member of ???std???
 ../libs/type_traits/test/has_virtual_destructor_test.cpp:58: error:
 ???bad_alloc??? is not a member of ???std???
 ../libs/type_traits/test/has_virtual_destructor_test.cpp:58: error:
 template argument 1 is invalid
 ../libs/type_traits/test/has_virtual_destructor_test.cpp:58: error:
 template argument 1 is invalid
 ../libs/type_traits/test/has_virtual_destructor_test.cpp:58: error:
 ???bad_alloc??? is not a member of ???std???
 ../libs/type_traits/test/has_virtual_destructor_test.cpp:58: error:
 ???bad_alloc??? is not a member of ???std???
 ../libs/type_traits/test/has_virtual_destructor_test.cpp:58: error:
 template argument 1 is invalid
 ../libs/type_traits/test/has_virtual_destructor_test.cpp:58: error:
 ???bad_alloc??? is not a member of ???std???
 ../libs/type_traits/test/has_virtual_destructor_test.cpp:58: error:
 ???bad_alloc??? is not a member of ???std???
 ../libs/type_traits/test/has_virtual_destructor_test.cpp:58: error:
 template argument 1 is invalid
 ../libs/type_traits/test/has_virtual_destructor_test.cpp:58: error:
 ???bad_alloc??? is not a member of ???std???
 ../libs/type_traits/test/has_virtual_destructor_test.cpp:58: error:
 ???bad_alloc??? is not a member of ???std???
 ../libs/type_traits/test/has_virtual_destructor_test.cpp:58: error:
 template argument 1 is invalid
 ../libs/type_traits/test/has_virtual_destructor_test.cpp:58: error:
 ???bad_alloc??? is not a member of ???std???
 ../libs/type_traits/test/has_virtual_destructor_test.cpp:58: error:
 ???bad_alloc??? is not a member of ???std???
 ../libs/type_traits/test/has_virtual_destructor_test.cpp:58: error:
 template argument 1 is invalid
 ../libs/type_traits/test/has_virtual_destructor_test.cpp:58: error:
 template argument 1 is invalid
 ../libs/type_traits/test/has_virtual_destructor_test.cpp:58: error:
 ???bad_alloc??? is not a member of ???std???
 ../libs/type_traits/test/has_virtual_destructor_test.cpp:58: error:
 ???bad_alloc??? is not a member of ???std???
 ../libs/type_traits/test/has_virtual_destructor_test.cpp:58: error:
 template argument 1 is invalid
 ../libs/type_traits/test/has_virtual_destructor_test.cpp:58: error:
 template argument 1 is invalid
 }}}

   I propose to #include <new> to define std::bad_alloc class:

 {{{
 Index: libs/type_traits/test/has_virtual_destructor_test.cpp
 ===================================================================
 --- libs/type_traits/test/has_virtual_destructor_test.cpp (revision
 43111)
 +++ libs/type_traits/test/has_virtual_destructor_test.cpp (working
 copy)
 @@ -12,6 +12,7 @@
  # include <boost/type_traits/has_virtual_destructor.hpp>
  #endif

 +#include <new>
  #include <iostream>
  #include <stdexcept>
 }}}

--
Ticket URL: <http://svn.boost.org/trac/boost/ticket/1626>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.


This archive was generated by hypermail 2.1.7 : 2017-02-16 18:49:57 UTC