Boost C++ Libraries: Ticket #1610: [MSVC/STLport] [tree/common.hpp] Standard library requirements violation(incomplete type as vector parameter) https://svn.boost.org/trac10/ticket/1610 <p> <strong>boost/spirit/tree/common.hpp</strong> </p> <pre class="wiki">template &lt;typename T&gt; struct tree_node { typedef T parse_node_t; #if !defined(BOOST_SPIRIT_USE_BOOST_ALLOCATOR_FOR_TREES) typedef std::allocator&lt;tree_node&lt;T&gt; &gt; allocator_type; #elif !defined(BOOST_SPIRIT_USE_LIST_FOR_TREES) typedef boost::pool_allocator&lt;tree_node&lt;T&gt; &gt; allocator_type; #else typedef boost::fast_pool_allocator&lt;tree_node&lt;T&gt; &gt; allocator_type; #endif #if !defined(BOOST_SPIRIT_USE_LIST_FOR_TREES) typedef std::vector&lt;tree_node&lt;T&gt;, allocator_type&gt; children_t; #else typedef std::list&lt;tree_node&lt;T&gt;, allocator_type&gt; children_t; #endif // BOOST_SPIRIT_USE_LIST_FOR_TREES typedef typename children_t::iterator tree_iterator; typedef typename children_t::const_iterator const_tree_iterator; </pre><p> The problem: <em>children_t::blablabla</em> triggers implicit instantiation of <em>children_t</em>, which have <em>tree_node</em> as its template parameter i.e. incomplete type. This code violates <strong>17.4.3.6/2</strong> </p> <pre class="wiki">In particular, the effects are undefined in the following cases: ... — if an incomplete type (3.9) is used as a template argument when instantiating a template component. </pre><p> It works with almost all STL implementations, but not with STLport-5.1.5/MSVC-8.0-SP1.<br /> </p> <hr /> <p> <strong>Build log:</strong> </p> <pre class="wiki">instantiate_cpp_grammar.cpp STLport: Auto linking to stlportstld.5.1.lib E:\.my\projects\install\.msvc\STLport-5.1.5\stlport\stl/type_traits.h(249) : error C2139: 'boost::spirit::tree_node&lt;T&gt;' : an undefined class is not allowed as an argument to compiler intrinsic type trait '__has_trivial_constructor' with [ T=boost::spirit::node_val_data&lt;boost::wave::cpplexer::lex_iterator&lt;token_type&gt;,boost::spirit::nil_t&gt; ] E:\.my\projects\install\.msvc\STLport-5.1.5\stlport\stl/_vector.h(137) : see reference to class template instantiation 'stlpd_std::__type_traits&lt;_Tp&gt;' being compiled with [ _Tp=boost::spirit::tree_node&lt;boost::spirit::node_val_data&lt;boost::wave::cpplexer::lex_iterator&lt;token_type&gt;,boost::spirit::nil_t&gt;&gt; ] E:\.my\projects\install\.msvc\STLport-5.1.5\stlport\stl/debug/_iterator.h(381) : see reference to class template instantiation 'stlpd_std::priv::_NonDbg_vector&lt;_Tp,_Alloc&gt;' being compiled with [ _Tp=boost::spirit::tree_node&lt;boost::spirit::node_val_data&lt;boost::wave::cpplexer::lex_iterator&lt;token_type&gt;,boost::spirit::nil_t&gt;&gt;, _Alloc=stlpd_std::allocator&lt;boost::spirit::tree_node&lt;boost::spirit::node_val_data&lt;boost::wave::cpplexer::lex_iterator&lt;token_type&gt;,boost::spirit::nil_t&gt;&gt;&gt; ] E:\.my\projects\install\.msvc\STLport-5.1.5\stlport\stl/debug/_vector.h(106) : see reference to class template instantiation 'stlpd_std::priv::__construct_checker&lt;_Container&gt;' being compiled with [ _Container=stlpd_std::priv::_NonDbg_vector&lt;boost::spirit::tree_node&lt;boost::spirit::node_val_data&lt;boost::wave::cpplexer::lex_iterator&lt;token_type&gt;,boost::spirit::nil_t&gt;&gt;,stlpd_std::allocator&lt;boost::spirit::tree_node&lt;boost::spirit::node_val_data&lt;boost::wave::cpplexer::lex_iterator&lt;token_type&gt;,boost::spirit::nil_t&gt;&gt;&gt;&gt; ] .\boost/spirit/tree/common.hpp(69) : see reference to class template instantiation 'stlpd_std::vector&lt;_Tp,_Alloc&gt;' being compiled with [ _Tp=boost::spirit::tree_node&lt;boost::spirit::node_val_data&lt;boost::wave::cpplexer::lex_iterator&lt;token_type&gt;,boost::spirit::nil_t&gt;&gt;, _Alloc=stlpd_std::allocator&lt;boost::spirit::tree_node&lt;boost::spirit::node_val_data&lt;boost::wave::cpplexer::lex_iterator&lt;token_type&gt;,boost::spirit::nil_t&gt;&gt;&gt; ] .\boost/spirit/tree/common.hpp(542) : see reference to class template instantiation 'boost::spirit::tree_node&lt;T&gt;' being compiled with [ T=boost::spirit::node_val_data&lt;boost::wave::cpplexer::lex_iterator&lt;token_type&gt;,boost::spirit::nil_t&gt; ] .\boost/spirit/tree/common.hpp(1454) : see reference to class template instantiation 'boost::spirit::tree_match&lt;IteratorT,NodeFactoryT,T&gt;' being compiled with [ IteratorT=boost::wave::cpplexer::lex_iterator&lt;token_type&gt;, NodeFactoryT=boost::wave::grammars::cpp_grammar_gen&lt;lexer_type,token_sequence_type&gt;::node_factory_type, T=boost::spirit::nil_t ] .\boost/wave/grammars/cpp_grammar.hpp(723) : see reference to class template instantiation 'boost::spirit::tree_parse_info&lt;IteratorT,NodeFactoryT&gt;' being compiled with [ IteratorT=boost::wave::cpplexer::lex_iterator&lt;token_type&gt;, NodeFactoryT=boost::wave::grammars::cpp_grammar_gen&lt;lexer_type,token_sequence_type&gt;::node_factory_type ] .\boost/wave/grammars/cpp_grammar.hpp(723) : while compiling class template member function 'boost::spirit::tree_parse_info&lt;IteratorT,NodeFactoryT&gt; boost::wave::grammars::cpp_grammar_gen&lt;LexIteratorT,TokenContainerT&gt;::parse_cpp_grammar(const boost::wave::cpplexer::lex_iterator&lt;TokenT&gt; &amp;,const boost::wave::cpplexer::lex_iterator&lt;TokenT&gt; &amp;,const boost::wave::util::file_position&lt;StringT&gt; &amp;,bool &amp;,boost::wave::cpplexer::lex_token&lt;&gt; &amp;,stlpd_std::list&lt;_Tp,_Alloc&gt; &amp;)' with [ IteratorT=boost::wave::cpplexer::lex_iterator&lt;token_type&gt;, NodeFactoryT=boost::wave::grammars::cpp_grammar_gen&lt;lexer_type,token_sequence_type&gt;::node_factory_type, LexIteratorT=lexer_type, TokenContainerT=token_sequence_type, TokenT=token_type, StringT=boost::wave::util::flex_string&lt;char,stlpd_std::char_traits&lt;char&gt;,stlpd_std::allocator&lt;char&gt;,boost::wave::util::CowString&lt;boost::wave::util::AllocatorStringStorage&lt;char&gt;&gt;&gt;, _Tp=token_type, _Alloc=boost::fast_pool_allocator&lt;token_type&gt; ] libs\wave\src\instantiate_cpp_grammar.cpp(47) : see reference to class template instantiation 'boost::wave::grammars::cpp_grammar_gen&lt;LexIteratorT,TokenContainerT&gt;' being compiled with [ LexIteratorT=lexer_type, TokenContainerT=token_sequence_type ] </pre> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/1610 Trac 1.4.3 Hartmut Kaiser Tue, 30 Nov 2010 16:37:45 GMT status changed; resolution set https://svn.boost.org/trac10/ticket/1610#comment:1 https://svn.boost.org/trac10/ticket/1610#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">wontfix</span> </li> </ul> <p> I'll go ahead and close this ticket as the problem does not persist in the current (and newest) version of Spirit. It's not related to Wave even if it is triggered by Wave ATM. We will port Wave over to the new version of Spirit soon, so it will be a no issue in this concrete context as well. </p> Ticket