Boost C++ Libraries: Ticket #7566: invalid use of std::forward when compiling with std=c++0x https://svn.boost.org/trac10/ticket/7566 <pre class="wiki">clang-darwin.compile.c++ ../../../bin.v2/libs/test/build/clang-darwin-3.0x/debug/link-static/threading-multi/exception_safety.o In file included from ../../../libs/test/src/exception_safety.cpp:16: In file included from ../../../boost/test/impl/exception_safety.ipp:30: In file included from ../../../boost/test/test_tools.hpp:328: In file included from ../../../boost/test/tools/impl.hpp:25: ../../../boost/test/tools/assertion.hpp:279:21: error: no member named 'forward' in namespace 'std' : m_value( std::forward&lt;T&gt;(val) ) ~~~~~^ ../../../boost/test/tools/assertion.hpp:279:29: error: 'T' does not refer to a value : m_value( std::forward&lt;T&gt;(val) ) ^ ../../../boost/test/tools/assertion.hpp:270:19: note: declared here template&lt;typename T&gt; </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/7566 Trac 1.4.3 Marshall Clow Wed, 24 Oct 2012 20:41:05 GMT <link>https://svn.boost.org/trac10/ticket/7566#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7566#comment:1</guid> <description> <p> You need to include libc++ with clang when using c++11 library features. </p> <p> See <a class="ext-link" href="http://marshall.calepin.co/llvmclang-and-standard-libraries-on-mac-os-x.html"><span class="icon">​</span>http://marshall.calepin.co/llvmclang-and-standard-libraries-on-mac-os-x.html</a> for more (non-boost specific) information about this. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Wed, 24 Oct 2012 22:37:01 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7566#comment:2 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7566#comment:2</guid> <description> <p> When I compile with </p> <pre class="wiki">using clang : 3.0xl : /Users/viboes/clang/llvmCore-3.0-rc1.install/bin/clang++ : &lt;cxxflags&gt;"-std=c++0x -stdlib=libc++" &lt;linkflags&gt;"-std=c++0x -stdlib=libc++" ; </pre><p> I'm getting the following. Is there something wrong on my installation? </p> <pre class="wiki">/Users/viboes/boost/trunk/libs/test/test gt-s8600:test viboes$ bjam toolset=clang-3.0xl -q ...patience... ...patience... ...found 1705 targets... ...updating 259 targets... clang-darwin.compile.c++ ../../../bin.v2/libs/test/test/class_properties_test.test/clang-darwin-3.0xl/debug/class_properties_test.o In file included from class_properties_test.cpp:17: In file included from ../../../boost/test/unit_test.hpp:19: In file included from ../../../boost/test/test_tools.hpp:20: In file included from ../../../boost/test/unit_test_log.hpp:27: In file included from ../../../boost/test/utils/wrap_stringstream.hpp:26: In file included from /usr/include/c++/v1/sstream:174: In file included from /usr/include/c++/v1/ostream:130: In file included from /usr/include/c++/v1/ios:216: In file included from /usr/include/c++/v1/__locale:18: In file included from /usr/include/c++/v1/mutex:177: /usr/include/c++/v1/functional:1115:47: error: function cannot return function type 'type-parameter-0-0 (type-parameter-0-1...)' template &lt;class _Fp, bool = !is_same&lt;_Fp, function&gt;::value &amp;&amp; ^ /usr/include/c++/v1/functional:1142:35: note: in instantiation of default argument for '__callable&lt;type-parameter-1-0&gt;' required here typename enable_if&lt;__callable&lt;_Fp&gt;::value&gt;::type* = 0); ^~~~~~~~~~~~~~~ Assertion failed: (!T.isNull() &amp;&amp; "Instantiation of injected-class-name cannot fail."), function FindInstantiatedDecl, file /Users/void/llvm/3.0-release/rc1/cfe.src/lib/Sema/SemaTemplateInstantiateDecl.cpp, line 3156. 0 clang 0x00000001060ac432 llvm::SmallVectorImpl&lt;llvm_regmatch_t&gt;::resize(unsigned int) + 2162 1 clang 0x00000001060ac959 llvm::SmallVectorImpl&lt;llvm_regmatch_t&gt;::resize(unsigned int) + 3481 2 libsystem_c.dylib 0x00007fff8f990cfa _sigtramp + 26 3 libsystem_c.dylib 0x00007fd482889be1 _sigtramp + 18446743888806776577 4 clang 0x00000001060ac686 llvm::SmallVectorImpl&lt;llvm_regmatch_t&gt;::resize(unsigned int) + 2758 5 clang 0x00000001060ac645 llvm::SmallVectorImpl&lt;llvm_regmatch_t&gt;::resize(unsigned int) + 2693 6 clang 0x00000001052c0d17 clang::TypeLocBuilder::pushFullUninitializedImpl(clang::QualType, unsigned long) + 3511 7 clang 0x00000001052ba204 clang::MemberPointerType::isMemberFunctionPointer() const + 98148 8 clang 0x00000001052a74cd clang::MemberPointerType::isMemberFunctionPointer() const + 21037 9 clang 0x00000001052a4fbe clang::MemberPointerType::isMemberFunctionPointer() const + 11550 10 clang 0x00000001052b90e4 clang::MemberPointerType::isMemberFunctionPointer() const + 93764 11 clang 0x00000001052bb047 clang::MemberPointerType::isMemberFunctionPointer() const + 101799 12 clang 0x00000001052b6977 clang::MemberPointerType::isMemberFunctionPointer() const + 83671 13 clang 0x00000001052b1856 clang::MemberPointerType::isMemberFunctionPointer() const + 62902 14 clang 0x00000001052b5700 clang::MemberPointerType::isMemberFunctionPointer() const + 78944 15 clang 0x00000001052bc14b clang::MemberPointerType::isMemberFunctionPointer() const + 106155 16 clang 0x00000001052ae0b4 clang::MemberPointerType::isMemberFunctionPointer() const + 48660 17 clang 0x00000001052adab1 clang::MemberPointerType::isMemberFunctionPointer() const + 47121 18 clang 0x00000001052542c9 std::vector&lt;std::pair&lt;llvm::APSInt, clang::CaseStmt*&gt;, std::allocator&lt;std::pair&lt;llvm::APSInt, clang::CaseStmt*&gt; &gt; &gt;::_M_insert_aux(__gnu_cxx::__normal_iterator&lt;std::pair&lt;llvm::APSInt, clang::CaseStmt*&gt;*, std::vector&lt;std::pair&lt;llvm::APSInt, clang::CaseStmt*&gt;, std::allocator&lt;std::pair&lt;llvm::APSInt, clang::CaseStmt*&gt; &gt; &gt; &gt;, std::pair&lt;llvm::APSInt, clang::CaseStmt*&gt; const&amp;) + 46745 19 clang 0x00000001052514ee std::vector&lt;std::pair&lt;llvm::APSInt, clang::CaseStmt*&gt;, std::allocator&lt;std::pair&lt;llvm::APSInt, clang::CaseStmt*&gt; &gt; &gt;::_M_insert_aux(__gnu_cxx::__normal_iterator&lt;std::pair&lt;llvm::APSInt, clang::CaseStmt*&gt;*, std::vector&lt;std::pair&lt;llvm::APSInt, clang::CaseStmt*&gt;, std::allocator&lt;std::pair&lt;llvm::APSInt, clang::CaseStmt*&gt; &gt; &gt; &gt;, std::pair&lt;llvm::APSInt, clang::CaseStmt*&gt; const&amp;) + 35006 20 clang 0x00000001052508ac std::vector&lt;std::pair&lt;llvm::APSInt, clang::CaseStmt*&gt;, std::allocator&lt;std::pair&lt;llvm::APSInt, clang::CaseStmt*&gt; &gt; &gt;::_M_insert_aux(__gnu_cxx::__normal_iterator&lt;std::pair&lt;llvm::APSInt, clang::CaseStmt*&gt;*, std::vector&lt;std::pair&lt;llvm::APSInt, clang::CaseStmt*&gt;, std::allocator&lt;std::pair&lt;llvm::APSInt, clang::CaseStmt*&gt; &gt; &gt; &gt;, std::pair&lt;llvm::APSInt, clang::CaseStmt*&gt; const&amp;) + 31868 21 clang 0x000000010507b9e1 std::vector&lt;std::pair&lt;unsigned int, clang::SourceLocation&gt;, std::allocator&lt;std::pair&lt;unsigned int, clang::SourceLocation&gt; &gt; &gt;::_M_insert_aux(__gnu_cxx::__normal_iterator&lt;std::pair&lt;unsigned int, clang::SourceLocation&gt;*, std::vector&lt;std::pair&lt;unsigned int, clang::SourceLocation&gt;, std::allocator&lt;std::pair&lt;unsigned int, clang::SourceLocation&gt; &gt; &gt; &gt;, std::pair&lt;unsigned int, clang::SourceLocation&gt; const&amp;) + 11649 22 clang 0x0000000105026c1a std::deque&lt;clang::Parser::ParsingClass*, std::allocator&lt;clang::Parser::ParsingClass*&gt; &gt;::_M_reallocate_map(unsigned long, bool) + 37098 23 clang 0x0000000105052928 llvm::SmallVectorTemplateBase&lt;clang::ParsedTemplateArgument, false&gt;::grow(unsigned long) + 37048 24 clang 0x0000000105049ca9 llvm::SmallVectorTemplateBase&lt;clang::ParsedTemplateArgument, false&gt;::grow(unsigned long) + 1081 25 clang 0x000000010504ae16 llvm::SmallVectorTemplateBase&lt;clang::ParsedTemplateArgument, false&gt;::grow(unsigned long) + 5542 26 clang 0x0000000105048c58 clang::PragmaFPContractHandler::~PragmaFPContractHandler() + 44232 27 clang 0x00000001050484a9 clang::PragmaFPContractHandler::~PragmaFPContractHandler() + 42265 28 clang 0x0000000105048005 clang::PragmaFPContractHandler::~PragmaFPContractHandler() + 41077 29 clang 0x000000010504863f clang::PragmaFPContractHandler::~PragmaFPContractHandler() + 42671 30 clang 0x0000000105027205 std::deque&lt;clang::Parser::ParsingClass*, std::allocator&lt;clang::Parser::ParsingClass*&gt; &gt;::_M_reallocate_map(unsigned long, bool) + 38613 31 clang 0x0000000105052557 llvm::SmallVectorTemplateBase&lt;clang::ParsedTemplateArgument, false&gt;::grow(unsigned long) + 36071 32 clang 0x0000000105007bbc clang::Parser::LateParsedMemberInitializer::~LateParsedMemberInitializer() + 25836 33 clang 0x0000000105011627 clang::Parser::LateParsedMemberInitializer::~LateParsedMemberInitializer() + 65367 34 clang 0x000000010500ff35 clang::Parser::LateParsedMemberInitializer::~LateParsedMemberInitializer() + 59493 35 clang 0x000000010500f6f4 clang::Parser::LateParsedMemberInitializer::~LateParsedMemberInitializer() + 57380 36 clang 0x000000010500e7a0 clang::Parser::LateParsedMemberInitializer::~LateParsedMemberInitializer() + 53456 37 clang 0x000000010501a45d clang::Parser::LateParsedAttribute::~LateParsedAttribute() + 31197 38 clang 0x0000000105045fb6 clang::PragmaFPContractHandler::~PragmaFPContractHandler() + 32806 39 clang 0x0000000105045d7e clang::PragmaFPContractHandler::~PragmaFPContractHandler() + 32238 40 clang 0x000000010504598b clang::PragmaFPContractHandler::~PragmaFPContractHandler() + 31227 41 clang 0x0000000105019e98 clang::Parser::LateParsedAttribute::~LateParsedAttribute() + 29720 42 clang 0x0000000105018794 clang::Parser::LateParsedAttribute::~LateParsedAttribute() + 23828 43 clang 0x00000001050174bf clang::Parser::LateParsedAttribute::~LateParsedAttribute() + 19007 44 clang 0x0000000105007ad0 clang::Parser::LateParsedMemberInitializer::~LateParsedMemberInitializer() + 25600 45 clang 0x00000001050461fc clang::PragmaFPContractHandler::~PragmaFPContractHandler() + 33388 46 clang 0x0000000105045d7e clang::PragmaFPContractHandler::~PragmaFPContractHandler() + 32238 47 clang 0x000000010504598b clang::PragmaFPContractHandler::~PragmaFPContractHandler() + 31227 48 clang 0x0000000105005e66 clang::Parser::LateParsedMemberInitializer::~LateParsedMemberInitializer() + 18326 49 clang 0x000000010504f684 llvm::SmallVectorTemplateBase&lt;clang::ParsedTemplateArgument, false&gt;::grow(unsigned long) + 24084 50 clang 0x0000000105013db7 clang::Parser::LateParsedAttribute::~LateParsedAttribute() + 4919 51 clang 0x00000001050138bf clang::Parser::LateParsedAttribute::~LateParsedAttribute() + 3647 52 clang 0x0000000105005f68 clang::Parser::LateParsedMemberInitializer::~LateParsedMemberInitializer() + 18584 53 clang 0x000000010504f8da llvm::SmallVectorTemplateBase&lt;clang::ParsedTemplateArgument, false&gt;::grow(unsigned long) + 24682 54 clang 0x0000000105013db7 clang::Parser::LateParsedAttribute::~LateParsedAttribute() + 4919 55 clang 0x00000001050138bf clang::Parser::LateParsedAttribute::~LateParsedAttribute() + 3647 56 clang 0x0000000105005fe7 clang::Parser::LateParsedMemberInitializer::~LateParsedMemberInitializer() + 18711 57 clang 0x000000010504f684 llvm::SmallVectorTemplateBase&lt;clang::ParsedTemplateArgument, false&gt;::grow(unsigned long) + 24084 58 clang 0x000000010504ef17 llvm::SmallVectorTemplateBase&lt;clang::ParsedTemplateArgument, false&gt;::grow(unsigned long) + 22183 59 clang 0x0000000104ffebbd clang::CUDAGlobalAttr* clang::Decl::getAttr&lt;clang::CUDAGlobalAttr&gt;() const + 749 60 clang 0x0000000104fdb9e6 llvm::DenseMap&lt;llvm::ValueMapCallbackVH&lt;llvm::Value const*, llvm::TrackingVH&lt;llvm::Value&gt;, llvm::ValueMapConfig&lt;llvm::Value const*&gt;, llvm::DenseMapInfo&lt;llvm::TrackingVH&lt;llvm::Value&gt; &gt; &gt;, llvm::TrackingVH&lt;llvm::Value&gt;, llvm::DenseMapInfo&lt;llvm::ValueMapCallbackVH&lt;llvm::Value const*, llvm::TrackingVH&lt;llvm::Value&gt;, llvm::ValueMapConfig&lt;llvm::Value const*&gt;, llvm::DenseMapInfo&lt;llvm::TrackingVH&lt;llvm::Value&gt; &gt; &gt; &gt;, llvm::DenseMapInfo&lt;llvm::TrackingVH&lt;llvm::Value&gt; &gt; &gt;::init(unsigned int) + 3334 61 clang 0x0000000104df212b llvm::DenseMap&lt;clang::IdentifierInfo const*, unsigned int, llvm::DenseMapInfo&lt;clang::IdentifierInfo const*&gt;, llvm::DenseMapInfo&lt;unsigned int&gt; &gt;::grow(unsigned int) + 14123 62 clang 0x0000000104ddcf45 llvm::SmallVectorImpl&lt;char const*&gt;::insert(char const**, char const* const&amp;) + 3013 63 clang 0x0000000104dd572a 64 clang 0x0000000104dd93df llvm::PrettyStackTraceProgram::~PrettyStackTraceProgram() + 831 65 clang 0x0000000104dd4234 66 clang 0x0000000000000039 Stack dump: 0. Program arguments: /Users/viboes/clang/llvmCore-3.0-rc1.install/bin/clang -cc1 -triple x86_64-apple-macosx10.7.4 -emit-obj -mrelax-all -disable-free -main-file-name class_properties_test.cpp -pic-level 1 -mdisable-fp-elim -masm-verbose -munwind-tables -target-cpu core2 -target-linker-version 127.2 -g -coverage-file ../../../bin.v2/libs/test/test/class_properties_test.test/clang-darwin-3.0xl/debug/class_properties_test.o -resource-dir /Users/viboes/clang/llvmCore-3.0-rc1.install/bin/../lib/clang/3.0 -D BOOST_ALL_NO_LIB=1 -D BOOST_TEST_DYN_LINK=1 -D BOOST_TEST_NO_AUTO_LINK=1 -I ../../.. -stdlib=libc++ -fmodule-cache-path /var/folders/5q/281f2tpd7536zxygsw3t6ckm0000gn/T/clang-module-cache -O0 -Wall -pedantic -std=c++0x -fdeprecated-macro -ferror-limit 19 -fmessage-length 0 -stack-protector 1 -fblocks -fobjc-runtime-has-arc -fobjc-runtime-has-weak -fobjc-dispatch-method=mixed -fcxx-exceptions -fexceptions -fdiagnostics-show-option -o ../../../bin.v2/libs/test/test/class_properties_test.test/clang-darwin-3.0xl/debug/class_properties_test.o -x c++ class_properties_test.cpp 1. /usr/include/c++/v1/functional:1142:52: current parser token 'value' 2. /usr/include/c++/v1/functional:473:1 &lt;Spelling=/usr/include/c++/v1/__config:272:37&gt;: parsing namespace 'std' 3. /usr/include/c++/v1/functional:473:1 &lt;Spelling=/usr/include/c++/v1/__config:272:59&gt;: parsing namespace '__1' 4. /usr/include/c++/v1/functional:1085:1: parsing struct/union/class body 'function' clang: error: unable to execute command: Illegal instruction: 4 clang: error: clang frontend command failed due to signal 2 (use -v to see invocation) clang: note: diagnostic msg: Please submit a bug report to http://llvm.org/bugs/ and include command line arguments and all diagnostic information. clang: note: diagnostic msg: Preprocessed source(s) are located at: clang: note: diagnostic msg: /var/folders/5q/281f2tpd7536zxygsw3t6ckm0000gn/T/class_properties_test-zLuqj6.ii "/Users/viboes/clang/llvmCore-3.0-rc1.install/bin/clang++" -x c++ -std=c++0x -stdlib=libc++ -O0 -g -O0 -fno-inline -Wall -pedantic -g -DBOOST_ALL_NO_LIB=1 -DBOOST_TEST_DYN_LINK=1 -DBOOST_TEST_NO_AUTO_LINK=1 -I"../../.." -c -o "../../../bin.v2/libs/test/test/class_properties_test.test/clang-darwin-3.0xl/debug/class_properties_test.o" "class_properties_test.cpp" </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>viboes</dc:creator> <pubDate>Wed, 24 Oct 2012 22:37:20 GMT</pubDate> <title>cc set https://svn.boost.org/trac10/ticket/7566#comment:3 https://svn.boost.org/trac10/ticket/7566#comment:3 <ul> <li><strong>cc</strong> <span class="trac-author">viboes</span> added </li> </ul> Ticket Marshall Clow Wed, 24 Oct 2012 22:41:36 GMT <link>https://svn.boost.org/trac10/ticket/7566#comment:4 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7566#comment:4</guid> <description> <p> Well, your clang crashed. That's clearly non-optimal. </p> <p> On the other hand, it appears that you've got a really old clang (3.0rc1). You might try a newer one. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Marshall Clow</dc:creator> <pubDate>Wed, 31 Oct 2012 17:31:38 GMT</pubDate> <title/> <link>https://svn.boost.org/trac10/ticket/7566#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/7566#comment:5</guid> <description> <p> Just built this with both the current Apple released clang (part of Xcode 4.5.1) and this morning's TOT clang. </p> <p> [ Using the same pattern as you in the user-config.jam ] </p> <p> Both worked fine. </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Gennadiy Rozental</dc:creator> <pubDate>Mon, 05 Nov 2012 01:08:23 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/7566#comment:6 https://svn.boost.org/trac10/ticket/7566#comment:6 <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> I believe this is already fixed </p> Ticket