Boost C++ Libraries: Ticket #7697: Boost.Test in C++11 w/ Clang fails with decltype usage https://svn.boost.org/trac10/ticket/7697 <p> Error trace reproduced below: </p> <pre class="wiki">clang-darwin.compile.c++ bin.v2/libs/test/build/clang-darwin-4.2.1/debug/unit_test_monitor.o In file included from libs/test/src/unit_test_monitor.cpp:16: In file included from ./boost/test/impl/unit_test_monitor.ipp:21: In file included from ./boost/test/test_tools.hpp:373: In file included from ./boost/test/tools/impl.hpp:25: ./boost/test/tools/assertion.hpp:158:1: error: expected ')' BOOST_TEST_FOR_EACH_CONST_OP( DEFINE_CONST_OPER ) ^ ./boost/test/tools/assertion.hpp:90:13: note: expanded from macro 'BOOST_TEST_FOR_EACH_CONST_OP' action( &gt;&gt;, RSH, &gt;&gt; ) \ ^ ./boost/test/tools/assertion.hpp:135:33: note: expanded from macro 'DEFINE_CONST_OPER' typedef DEDUCE_RESULT_TYPE( oper ) result_type; \ ^ ./boost/test/tools/assertion.hpp:126:103: note: expanded from macro 'DEDUCE_RESULT_TYPE' # define DEDUCE_RESULT_TYPE( oper ) typename boost::remove_reference&lt;decltype(boost::declval&lt;Lhs&gt;() oper boost::declval&lt;Rhs&gt;() )&gt;::type ^ ./boost/test/tools/assertion.hpp:158:31: note: to match this '(' BOOST_TEST_FOR_EACH_CONST_OP( DEFINE_CONST_OPER ) ^ ./boost/test/tools/assertion.hpp:90:5: note: expanded from macro 'BOOST_TEST_FOR_EACH_CONST_OP' action( &gt;&gt;, RSH, &gt;&gt; ) \ ^ ./boost/test/tools/assertion.hpp:135:13: note: expanded from macro 'DEFINE_CONST_OPER' typedef DEDUCE_RESULT_TYPE( oper ) result_type; \ ^ ./boost/test/tools/assertion.hpp:126:80: note: expanded from macro 'DEDUCE_RESULT_TYPE' # define DEDUCE_RESULT_TYPE( oper ) typename boost::remove_reference&lt;decltype(boost::declval&lt;Lhs&gt;() oper boost::declval&lt;Rhs&gt;() )&gt;::type ^ ./boost/test/tools/assertion.hpp:158:1: error: expected ')' BOOST_TEST_FOR_EACH_CONST_OP( DEFINE_CONST_OPER ) ^ ./boost/test/tools/assertion.hpp:92:5: note: expanded from macro 'BOOST_TEST_FOR_EACH_CONST_OP' BOOST_TEST_FOR_EACH_COMP_OP(action) \ ^ ./boost/test/tools/assertion.hpp:69:13: note: expanded from macro 'BOOST_TEST_FOR_EACH_COMP_OP' action( &gt; , GT, &lt;= ) \ ^ ./boost/test/tools/assertion.hpp:135:33: note: expanded from macro 'DEFINE_CONST_OPER' typedef DEDUCE_RESULT_TYPE( oper ) result_type; \ ^ ./boost/test/tools/assertion.hpp:126:103: note: expanded from macro 'DEDUCE_RESULT_TYPE' # define DEDUCE_RESULT_TYPE( oper ) typename boost::remove_reference&lt;decltype(boost::declval&lt;Lhs&gt;() oper boost::declval&lt;Rhs&gt;() )&gt;::type ^ ./boost/test/tools/assertion.hpp:158:31: note: to match this '(' BOOST_TEST_FOR_EACH_CONST_OP( DEFINE_CONST_OPER ) ^ ./boost/test/tools/assertion.hpp:92:33: note: expanded from macro 'BOOST_TEST_FOR_EACH_CONST_OP' BOOST_TEST_FOR_EACH_COMP_OP(action) \ ^ ./boost/test/tools/assertion.hpp:69:5: note: expanded from macro 'BOOST_TEST_FOR_EACH_COMP_OP' action( &gt; , GT, &lt;= ) \ ^ ./boost/test/tools/assertion.hpp:135:13: note: expanded from macro 'DEFINE_CONST_OPER' typedef DEDUCE_RESULT_TYPE( oper ) result_type; \ ^ ./boost/test/tools/assertion.hpp:126:80: note: expanded from macro 'DEDUCE_RESULT_TYPE' # define DEDUCE_RESULT_TYPE( oper ) typename boost::remove_reference&lt;decltype(boost::declval&lt;Lhs&gt;() oper boost::declval&lt;Rhs&gt;() )&gt;::type ^ 2 errors generated. "clang++" -x c++ -Wall -Wself-assign -std=c++11 -stdlib=libc++ -O0 -g -O0 -fno-inline -Wall -pedantic -g -DBOOST_ALL_NO_LIB=1 -DBOOST_TEST_DYN_LINK=1 -I"." -c -o "bin.v2/libs/test/build/clang-darwin-4.2.1/debug/unit_test_monitor.o" "libs/test/src/unit_test_monitor.cpp" ...failed clang-darwin.compile.c++ bin.v2/libs/test/build/clang-darwin-4.2.1/debug/unit_test_monitor.o... </pre><p> Clang version details: </p> <pre class="wiki">Apple clang version 4.1 (tags/Apple/clang-421.11.66) (based on LLVM 3.1svn) Target: x86_64-apple-darwin12.2.0 Thread model: posix </pre><p> My user-config.jam: </p> <pre class="wiki">using clang : : : &lt;cxxflags&gt;-Wall &lt;cxxflags&gt;-Wself-assign &lt;cxxflags&gt;-std=c++11 &lt;cxxflags&gt;-stdlib=libc++ &lt;linkflags&gt;-stdlib=libc++ ; </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/7697 Trac 1.4.3 Dean Michael Berris Fri, 16 Nov 2012 07:10:46 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/7697#comment:1 https://svn.boost.org/trac10/ticket/7697#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> Fixed as of <a class="changeset" href="https://svn.boost.org/trac10/changeset/81362" title="clang bug workaround">r81362</a> </p> Ticket