Boost C++ Libraries: Ticket #13387: Test header fails to compile https://svn.boost.org/trac10/ticket/13387 <p> The Boost header policy (<a href="http://www.boost.org/development/header.html">http://www.boost.org/development/header.html</a>) requires: </p> <blockquote class="citation"> <p> Make sure that a translation unit consisting of just the contents of the header file will compile successfully. </p> </blockquote> <p> ...but compiling: </p> <div class="wiki-code"><div class="code"><pre><span class="cp">#include</span> <span class="cpf">&lt;boost/test/data/test_case.hpp&gt;</span><span class="cp"></span> </pre></div></div><p> ...gives errors... </p> <pre class="wiki">In file included from geoff.cpp:1:0: /tmp/test-develop/include/boost/test/data/test_case.hpp:198:18: error: ‘list’ in namespace ‘std’ does not name a template type mutable std::list&lt;test_unit*&gt; m_test_cases; ^~~~ /tmp/test-develop/include/boost/test/data/test_case.hpp: In constructor ‘boost::unit_test::data::ds_detail::test_case_gen&lt;TestCase, DataSet&gt;::test_case_gen(boost::unit_test::data::ds_detail::test_case_gen&lt;TestCase, DataSet&gt;&amp;&amp;)’: /tmp/test-develop/include/boost/test/data/test_case.hpp:138:7: error: class ‘boost::unit_test::data::ds_detail::test_case_gen&lt;TestCase, DataSet&gt;’ does not have any field named ‘m_test_cases’ , m_test_cases( std::move(gen.m_test_cases) ) ^~~~~~~~~~~~ /tmp/test-develop/include/boost/test/data/test_case.hpp: In member function ‘virtual boost::unit_test::test_unit* boost::unit_test::data::ds_detail::test_case_gen&lt;TestCase, DataSet&gt;::next() const’: /tmp/test-develop/include/boost/test/data/test_case.hpp:153:13: error: ‘m_test_cases’ was not declared in this scope if( m_test_cases.empty() ) ^~~~~~~~~~~~ /tmp/test-develop/include/boost/test/data/test_case.hpp:156:26: error: ‘m_test_cases’ was not declared in this scope test_unit* res = m_test_cases.front(); ^~~~~~~~~~~~ /tmp/test-develop/include/boost/test/data/test_case.hpp: In member function ‘void boost::unit_test::data::ds_detail::test_case_gen&lt;TestCase, DataSet&gt;::operator()(Arg&amp;&amp; ...) const’: /tmp/test-develop/include/boost/test/data/test_case.hpp:178:9: error: ‘m_test_cases’ was not declared in this scope m_test_cases.push_back( ^~~~~~~~~~~~ </pre><p> This follows on from <a class="closed ticket" href="https://svn.boost.org/trac10/ticket/12228" title="#12228: Bugs: Some test headers fail to compile independently (closed: fixed)">ticket:12228</a>. </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/13387 Trac 1.4.3 Tony Lewis <tonyelewis@…> Wed, 10 Jan 2018 23:19:01 GMT <link>https://svn.boost.org/trac10/ticket/13387#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/13387#comment:1</guid> <description> <p> I should say: the above errors are from GCC 6.2. </p> <p> Clang 5.0 gives: </p> <pre class="wiki">In file included from geoff.cpp:1: In file included from /tmp/test-develop/include/boost/test/data/test_case.hpp:17: In file included from /tmp/test-develop/include/boost/test/data/dataset.hpp:16: In file included from /tmp/test-develop/include/boost/test/data/monomorphic.hpp:16: In file included from /tmp/test-develop/include/boost/test/data/monomorphic/array.hpp:17: In file included from /tmp/test-develop/include/boost/test/data/monomorphic/fwd.hpp:19: /tmp/test-develop/include/boost/test/utils/is_forward_iterable.hpp:204:5: error: unknown type name 'BOOST_STATIC_ASSERT' BOOST_STATIC_ASSERT((is_forward_iterable&lt;T&gt;::value)); //, "only for forward iterable types"); ^ /tmp/test-develop/include/boost/test/utils/is_forward_iterable.hpp:204:50: error: non-friend class member 'value' cannot have a qualified name BOOST_STATIC_ASSERT((is_forward_iterable&lt;T&gt;::value)); //, "only for forward iterable types"); ~~~~~~~~~~~~~~~~~~~~~~~~^ /tmp/test-develop/include/boost/test/utils/is_forward_iterable.hpp:221:22: error: no template named 'add_const' in namespace 'boost'; did you mean 'std::add_const'? typedef typename boost::add_const&lt;T&gt;::type T_const; ^~~~~~~ /opt/clang+llvm-5.0.0-linux-x86_64-ubuntu16.04/bin/../include/c++/v1/type_traits:1033:50: note: 'std::add_const' declared here template &lt;class _Tp&gt; struct _LIBCPP_TEMPLATE_VIS add_const ^ In file included from geoff.cpp:1: In file included from /tmp/test-develop/include/boost/test/data/test_case.hpp:17: In file included from /tmp/test-develop/include/boost/test/data/dataset.hpp:16: In file included from /tmp/test-develop/include/boost/test/data/monomorphic.hpp:16: In file included from /tmp/test-develop/include/boost/test/data/monomorphic/array.hpp:17: In file included from /tmp/test-develop/include/boost/test/data/monomorphic/fwd.hpp:19: /tmp/test-develop/include/boost/test/utils/is_forward_iterable.hpp:222:22: error: no template named 'add_pointer' in namespace 'boost'; did you mean 'std::add_pointer'? typedef typename boost::add_pointer&lt;T_const&gt;::type const_iterator; ^~~~~~~ /opt/clang+llvm-5.0.0-linux-x86_64-ubuntu16.04/bin/../include/c++/v1/type_traits:1171:50: note: 'std::add_pointer' declared here template &lt;class _Tp&gt; struct _LIBCPP_TEMPLATE_VIS add_pointer ^ In file included from geoff.cpp:1: In file included from /tmp/test-develop/include/boost/test/data/test_case.hpp:17: In file included from /tmp/test-develop/include/boost/test/data/dataset.hpp:16: In file included from /tmp/test-develop/include/boost/test/data/monomorphic.hpp:16: In file included from /tmp/test-develop/include/boost/test/data/monomorphic/array.hpp:17: /tmp/test-develop/include/boost/test/data/monomorphic/fwd.hpp:122:33: error: use of undeclared identifier 'is_container_forward_iterable' inline typename std::enable_if&lt;!is_container_forward_iterable&lt;T&gt;::value &amp;&amp; ^ /tmp/test-develop/include/boost/test/data/monomorphic/fwd.hpp:122:63: error: 'T' does not refer to a value inline typename std::enable_if&lt;!is_container_forward_iterable&lt;T&gt;::value &amp;&amp; ^ /tmp/test-develop/include/boost/test/data/monomorphic/fwd.hpp:121:19: note: declared here template&lt;typename T&gt; ^ /tmp/test-develop/include/boost/test/data/monomorphic/fwd.hpp:122:67: error: definition or redeclaration of 'value' cannot name the global scope inline typename std::enable_if&lt;!is_container_forward_iterable&lt;T&gt;::value &amp;&amp; ~~^ /tmp/test-develop/include/boost/test/data/monomorphic/fwd.hpp:122:67: error: no member named 'value' in the global namespace inline typename std::enable_if&lt;!is_container_forward_iterable&lt;T&gt;::value &amp;&amp; ~~^ /tmp/test-develop/include/boost/test/data/monomorphic/fwd.hpp:122:72: error: expected ';' at end of declaration inline typename std::enable_if&lt;!is_container_forward_iterable&lt;T&gt;::value &amp;&amp; ^ /tmp/test-develop/include/boost/test/data/monomorphic/fwd.hpp:123:32: error: expected unqualified-id !monomorphic::is_dataset&lt;T&gt;::value &amp;&amp; ^ /tmp/test-develop/include/boost/test/data/monomorphic/fwd.hpp:132:32: error: use of undeclared identifier 'is_container_forward_iterable' inline typename std::enable_if&lt;is_container_forward_iterable&lt;C&gt;::value,monomorphic::collection&lt;C&gt;&gt;::type ^ /tmp/test-develop/include/boost/test/data/monomorphic/fwd.hpp:132:62: error: 'C' does not refer to a value inline typename std::enable_if&lt;is_container_forward_iterable&lt;C&gt;::value,monomorphic::collection&lt;C&gt;&gt;::type ^ /tmp/test-develop/include/boost/test/data/monomorphic/fwd.hpp:131:19: note: declared here template&lt;typename C&gt; ^ /tmp/test-develop/include/boost/test/data/monomorphic/fwd.hpp:132:66: error: definition or redeclaration of 'value' cannot name the global scope inline typename std::enable_if&lt;is_container_forward_iterable&lt;C&gt;::value,monomorphic::collection&lt;C&gt;&gt;::type ~~^ /tmp/test-develop/include/boost/test/data/monomorphic/fwd.hpp:132:71: error: a template declaration can only declare a single entity inline typename std::enable_if&lt;is_container_forward_iterable&lt;C&gt;::value,monomorphic::collection&lt;C&gt;&gt;::type ^ /tmp/test-develop/include/boost/test/data/monomorphic/fwd.hpp:159:1: error: redefinition of 'make' as different kind of symbol make( std::initializer_list&lt;T&gt;&amp;&amp; ); ^ /tmp/test-develop/include/boost/test/data/monomorphic/fwd.hpp:152:1: note: previous definition is here make( char const* str ); ^ /tmp/test-develop/include/boost/test/data/monomorphic/fwd.hpp:159:12: error: no member named 'initializer_list' in namespace 'std' make( std::initializer_list&lt;T&gt;&amp;&amp; ); ~~~~~^ /tmp/test-develop/include/boost/test/data/monomorphic/fwd.hpp:159:29: error: 'T' does not refer to a value make( std::initializer_list&lt;T&gt;&amp;&amp; ); ^ /tmp/test-develop/include/boost/test/data/monomorphic/fwd.hpp:157:19: note: declared here template&lt;typename T&gt; ^ /tmp/test-develop/include/boost/test/data/monomorphic/fwd.hpp:159:34: error: expected identifier make( std::initializer_list&lt;T&gt;&amp;&amp; ); ^ /tmp/test-develop/include/boost/test/data/monomorphic/fwd.hpp:168:35: error: no template named 'declval'; did you mean 'std::declval'? typedef decltype( data::make( declval&lt;DataSet&gt;() ) ) type; ^ /opt/clang+llvm-5.0.0-linux-x86_64-ubuntu16.04/bin/../include/c++/v1/type_traits:1117:1: note: 'std::declval' declared here declval(); ^ fatal error: too many errors emitted, stopping now [-ferror-limit=] 20 errors generated. </pre> </description> <category>Ticket</category> </item> <item> <dc:creator>Raffi Enficiaud</dc:creator> <pubDate>Thu, 18 Jan 2018 14:07:19 GMT</pubDate> <title>owner, status, milestone changed https://svn.boost.org/trac10/ticket/13387#comment:2 https://svn.boost.org/trac10/ticket/13387#comment:2 <ul> <li><strong>owner</strong> changed from <span class="trac-author">Gennadiy Rozental</span> to <span class="trac-author">Raffi Enficiaud</span> </li> <li><strong>status</strong> <span class="trac-field-old">new</span> → <span class="trac-field-new">assigned</span> </li> <li><strong>milestone</strong> <span class="trac-field-old">To Be Determined</span> → <span class="trac-field-new">Boost 1.67.0</span> </li> </ul> Ticket Raffi Enficiaud Fri, 19 Jan 2018 13:39:11 GMT <link>https://svn.boost.org/trac10/ticket/13387#comment:3 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/13387#comment:3</guid> <description> <p> On develop </p> </description> <category>Ticket</category> </item> <item> <dc:creator>Raffi Enficiaud</dc:creator> <pubDate>Mon, 22 Jan 2018 12:54:19 GMT</pubDate> <title>status changed; resolution set https://svn.boost.org/trac10/ticket/13387#comment:4 https://svn.boost.org/trac10/ticket/13387#comment:4 <ul> <li><strong>status</strong> <span class="trac-field-old">assigned</span> → <span class="trac-field-new">closed</span> </li> <li><strong>resolution</strong> → <span class="trac-field-new">fixed</span> </li> </ul> <p> On master </p> Ticket Tony E Lewis <tonyelewis@…> Tue, 23 Jan 2018 13:56:17 GMT <link>https://svn.boost.org/trac10/ticket/13387#comment:5 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/13387#comment:5</guid> <description> <p> Thanks very much - this now works for me. </p> <p> It still fails under Clang but that seems to be because Clang defaults to <code>-std=c++98</code> and that header requires ≥ C++11. When compiling that header as C++98 under GCC, the relevant error about the required standard is the first error but under Clang that message is a bit buried. If you could make it the first error under both, that might save some users a lot of time. </p> </description> <category>Ticket</category> </item> </channel> </rss>