[Boost-bugs] [Boost C++ Libraries] #1610: [MSVC/STLport] [tree/common.hpp] Standard library requirements violation(incomplete type as vector parameter)

Subject: [Boost-bugs] [Boost C++ Libraries] #1610: [MSVC/STLport] [tree/common.hpp] Standard library requirements violation(incomplete type as vector parameter)
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2008-01-28 18:04:36


#1610: [MSVC/STLport] [tree/common.hpp] Standard library requirements
violation(incomplete type as vector parameter)
----------------------------------------+-----------------------------------
 Reporter: archimed7592+svc_at_[hidden] | Owner: djowel
     Type: Bugs | Status: new
Milestone: Boost 1.36.0 | Component: spirit
  Version: Boost 1.34.1 | Severity: Problem
 Keywords: stlport |
----------------------------------------+-----------------------------------
 '''boost/spirit/tree/common.hpp'''
 {{{
 template <typename T>
 struct tree_node
 {
     typedef T parse_node_t;

 #if !defined(BOOST_SPIRIT_USE_BOOST_ALLOCATOR_FOR_TREES)
     typedef std::allocator<tree_node<T> > allocator_type;
 #elif !defined(BOOST_SPIRIT_USE_LIST_FOR_TREES)
     typedef boost::pool_allocator<tree_node<T> > allocator_type;
 #else
     typedef boost::fast_pool_allocator<tree_node<T> > allocator_type;
 #endif

 #if !defined(BOOST_SPIRIT_USE_LIST_FOR_TREES)
     typedef std::vector<tree_node<T>, allocator_type> children_t;
 #else
     typedef std::list<tree_node<T>, allocator_type> 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;
 }}}

 The problem: ''children_t::blablabla'' triggers implicit instantiation of
 ''children_t'', which have ''tree_node'' as its template parameter i.e.
 incomplete type. This code violates '''17.4.3.6/2'''

 {{{
 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.

 }}}

 It works with almost all STL implementations, but not with
 STLport-5.1.5/MSVC-8.0-SP1.[[BR]]



 ----
 '''Build log:'''

 {{{
 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<T>' : an undefined class is not
 allowed as an argument to compiler intrinsic type trait
 '__has_trivial_constructor'
         with
         [
 T=boost::spirit::node_val_data<boost::wave::cpplexer::lex_iterator<token_type>,boost::spirit::nil_t>
         ]
 E:\.my\projects\install\.msvc\STLport-5.1.5\stlport\stl/_vector.h(137) :
 see reference to class template instantiation
 'stlpd_std::__type_traits<_Tp>' being compiled
         with
         [
 _Tp=boost::spirit::tree_node<boost::spirit::node_val_data<boost::wave::cpplexer::lex_iterator<token_type>,boost::spirit::nil_t>>
         ]
 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<_Tp,_Alloc>' being compiled
         with
         [
 _Tp=boost::spirit::tree_node<boost::spirit::node_val_data<boost::wave::cpplexer::lex_iterator<token_type>,boost::spirit::nil_t>>,
 _Alloc=stlpd_std::allocator<boost::spirit::tree_node<boost::spirit::node_val_data<boost::wave::cpplexer::lex_iterator<token_type>,boost::spirit::nil_t>>>
         ]
 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<_Container>' being compiled
         with
         [
 _Container=stlpd_std::priv::_NonDbg_vector<boost::spirit::tree_node<boost::spirit::node_val_data<boost::wave::cpplexer::lex_iterator<token_type>,boost::spirit::nil_t>>,stlpd_std::allocator<boost::spirit::tree_node<boost::spirit::node_val_data<boost::wave::cpplexer::lex_iterator<token_type>,boost::spirit::nil_t>>>>
         ]
         .\boost/spirit/tree/common.hpp(69) : see reference to class
 template instantiation 'stlpd_std::vector<_Tp,_Alloc>' being compiled
         with
         [
 _Tp=boost::spirit::tree_node<boost::spirit::node_val_data<boost::wave::cpplexer::lex_iterator<token_type>,boost::spirit::nil_t>>,
 _Alloc=stlpd_std::allocator<boost::spirit::tree_node<boost::spirit::node_val_data<boost::wave::cpplexer::lex_iterator<token_type>,boost::spirit::nil_t>>>
         ]
         .\boost/spirit/tree/common.hpp(542) : see reference to class
 template instantiation 'boost::spirit::tree_node<T>' being compiled
         with
         [
 T=boost::spirit::node_val_data<boost::wave::cpplexer::lex_iterator<token_type>,boost::spirit::nil_t>
         ]
         .\boost/spirit/tree/common.hpp(1454) : see reference to class
 template instantiation
 'boost::spirit::tree_match<IteratorT,NodeFactoryT,T>' being compiled
         with
         [
             IteratorT=boost::wave::cpplexer::lex_iterator<token_type>,
 NodeFactoryT=boost::wave::grammars::cpp_grammar_gen<lexer_type,token_sequence_type>::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<IteratorT,NodeFactoryT>' being compiled
         with
         [
             IteratorT=boost::wave::cpplexer::lex_iterator<token_type>,
 NodeFactoryT=boost::wave::grammars::cpp_grammar_gen<lexer_type,token_sequence_type>::node_factory_type
         ]
         .\boost/wave/grammars/cpp_grammar.hpp(723) : while compiling class
 template member function
 'boost::spirit::tree_parse_info<IteratorT,NodeFactoryT>
 boost::wave::grammars::cpp_grammar_gen<LexIteratorT,TokenContainerT>::parse_cpp_grammar(const
 boost::wave::cpplexer::lex_iterator<TokenT> &,const
 boost::wave::cpplexer::lex_iterator<TokenT> &,const
 boost::wave::util::file_position<StringT> &,bool
 &,boost::wave::cpplexer::lex_token<> &,stlpd_std::list<_Tp,_Alloc> &)'
         with
         [
             IteratorT=boost::wave::cpplexer::lex_iterator<token_type>,
 NodeFactoryT=boost::wave::grammars::cpp_grammar_gen<lexer_type,token_sequence_type>::node_factory_type,
             LexIteratorT=lexer_type,
             TokenContainerT=token_sequence_type,
             TokenT=token_type,
 StringT=boost::wave::util::flex_string<char,stlpd_std::char_traits<char>,stlpd_std::allocator<char>,boost::wave::util::CowString<boost::wave::util::AllocatorStringStorage<char>>>,
             _Tp=token_type,
             _Alloc=boost::fast_pool_allocator<token_type>
         ]
         libs\wave\src\instantiate_cpp_grammar.cpp(47) : see reference to
 class template instantiation
 'boost::wave::grammars::cpp_grammar_gen<LexIteratorT,TokenContainerT>'
 being compiled
         with
         [
             LexIteratorT=lexer_type,
             TokenContainerT=token_sequence_type
         ]

 }}}

--
Ticket URL: <http://svn.boost.org/trac/boost/ticket/1610>
Boost C++ Libraries <http://www.boost.org/>
Boost provides free peer-reviewed portable C++ source libraries.


This archive was generated by hypermail 2.1.7 : 2017-02-16 18:49:57 UTC