Boost C++ Libraries: Ticket #1626: [type_traits] "bad_alloc is not a member of std" in has_virtual_destructor_test.cpp https://svn.boost.org/trac10/ticket/1626 <p> I've got the following errors while testing the boost with stdcxx library on icc-10.1/Linux: </p> <pre class="wiki">../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&lt;std::bad_alloc&gt;::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&lt;std::bad_alloc&gt;::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&lt;std::bad_alloc&gt;::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&lt;std::bad_alloc&gt;::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&lt;std::bad_alloc&gt;::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&lt;std::bad_alloc&gt;::value, true, false); ^ compilation aborted for ../libs/type_traits/test/has_virtual_destructor_test.cpp (code 2) </pre><p> The same result on gcc/Linux: </p> <pre class="wiki">../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 </pre><blockquote> <p> I propose to #include &lt;new&gt; to define std::bad_alloc class: </p> </blockquote> <pre class="wiki">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 &lt;boost/type_traits/has_virtual_destructor.hpp&gt; #endif +#include &lt;new&gt; #include &lt;iostream&gt; #include &lt;stdexcept&gt; </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/1626 Trac 1.4.3 John Maddock Sun, 30 Mar 2008 16:08:04 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/1626#comment:1 https://svn.boost.org/trac10/ticket/1626#comment:1 <ul> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> Confirmed and fixed in Trunk. </p> Ticket