id,summary,reporter,owner,description,type,status,milestone,component,version,severity,resolution,keywords,cc 3278,invalid usage of std::list in match_results,Andrey Semashev,Eric Niebler,"I use MSVC 9 with STLport 5.2.1. When compiling the following code snippet: {{{ #include #include namespace xpressive = boost::xpressive; int main(int, char*[]) { typedef xpressive::basic_regex< std::string::const_iterator > regex_t; regex_t rex = regex_t::compile(std::string(""abc""), regex_t::ECMAScript | regex_t::optimize); return 0; } }}} I get the following error: {{{ xpressive.cpp ../STLPort/stlport\stl/type_traits.h(249) : error C2139: 'boost::xpressive::match_results' : an undefined class is not allowed as an argument to compiler intrinsic type trait '__has_trivial_constructor' with [ BidiIter=const char * ] ../STLPort/stlport\stl/pointers/_tools.h(76) : see reference to class template instantiation 'stlp_std::__type_traits<_Tp>' being compiled with [ _Tp=boost::xpressive::match_results ] ../STLPort/stlport\stl/pointers/_list.h(61) : see reference to class template instantiation 'stlp_std::priv::_StorageType<_Tp>' being compiled with [ _Tp=boost::xpressive::match_results ] .\boost/xpressive/detail/core/results_cache.hpp(43) : see reference to class template instantiation 'stlp_std::list<_Tp>' being compiled with [ _Tp=boost::xpressive::match_results ] .\boost/xpressive/match_results.hpp(1341) : see reference to class template instantiation 'boost::xpressive::detail::nested_results' being compiled with [ BidiIter=const char * ] .\boost/xpressive/detail/core/state.hpp(239) : see reference to class template instantiation 'boost::xpressive::match_results' being compiled with [ BidiIter=const char * ] .\boost/xpressive/detail/core/state.hpp(235) : while compiling class template member function 'void boost::xpressive::detail::match_state::swap_context(boost::xpressive::detail::match_context &)' with [ BidiIter=const char * ] .\boost/xpressive/detail/core/matcher/end_matcher.hpp(35) : see reference to class template instantiation 'boost::xpressive::detail::match_state' being compiled with [ BidiIter=const char * ] .\boost/xpressive/detail/dynamic/dynamic.hpp(80) : see reference to function template instantiation 'bool boost::xpressive::detail::end_matcher::match(boost::xpressive::detail::match_state &,const Next &)' being compiled with [ BidiIter=const char *, T=const boost::xpressive::detail::matchable_ex, Next=const boost::xpressive::detail::matchable_ex ] .\boost/xpressive/detail/dynamic/dynamic.hpp(79) : while compiling class template member function 'bool boost::xpressive::detail::dynamic_xpression::match(boost::xpressive::detail::match_state &) const' with [ Matcher=boost::xpressive::detail::end_matcher, BidiIter=const char * ] .\boost/xpressive/detail/dynamic/dynamic.hpp(164) : see reference to class template instantiation 'boost::xpressive::detail::dynamic_xpression' being compiled with [ Matcher=boost::xpressive::detail::end_matcher, BidiIter=const char * ] .\boost/xpressive/regex_compiler.hpp(216) : see reference to function template instantiation 'boost::xpressive::detail::sequence boost::xpressive::detail::make_dynamic(const Matcher &)' being compiled with [ BidiIter=const char *, Matcher=boost::xpressive::detail::end_matcher ] .\boost/xpressive/regex_compiler.hpp(120) : see reference to function template instantiation 'boost::xpressive::basic_regex boost::xpressive::regex_compiler::compile_(FwdIter,FwdIter,boost::xpressive::regex_compiler::flag_type,stlp_std::forward_iterator_tag)' being compiled with [ BidiIter=const char *, InputIter=const char *, FwdIter=const char * ] .\boost/xpressive/regex_compiler.hpp(129) : see reference to function template instantiation 'boost::xpressive::basic_regex boost::xpressive::regex_compiler::compile(InputIter,InputIter,boost::xpressive::regex_compiler::flag_type)' being compiled with [ BidiIter=const char *, InputIter=const char * ] .\boost/xpressive/basic_regex.hpp(191) : see reference to function template instantiation 'boost::xpressive::basic_regex boost::xpressive::regex_compiler::compile(const InputRange &,boost::xpressive::regex_compiler::flag_type)' being compiled with [ BidiIter=const char *, InputRange=stlp_std::basic_string,stlp_std::allocator> ] xpressive.cpp(9) : see reference to function template instantiation 'boost::xpressive::basic_regex boost::xpressive::basic_regex::compile>(const InputRange &,boost::xpressive::basic_regex::flag_type)' being compiled with [ BidiIter=const char *, _CharT=char, _Traits=stlp_std::char_traits, _Alloc=stlp_std::allocator, InputRange=stlp_std::basic_string,stlp_std::allocator> ] ../STLPort/stlport\stl/type_traits.h(250) : error C2139: 'boost::xpressive::match_results' : an undefined class is not allowed as an argument to compiler intrinsic type trait '__has_trivial_copy' with [ BidiIter=const char * ] ../STLPort/stlport\stl/type_traits.h(251) : error C2139: 'boost::xpressive::match_results' : an undefined class is not allowed as an argument to compiler intrinsic type trait '__has_trivial_assign' with [ BidiIter=const char * ] ../STLPort/stlport\stl/type_traits.h(252) : error C2139: 'boost::xpressive::match_results' : an undefined class is not allowed as an argument to compiler intrinsic type trait '__has_trivial_destructor' with [ BidiIter=const char * ] ../STLPort/stlport\stl/type_traits.h(253) : error C2139: 'boost::xpressive::match_results' : an undefined class is not allowed as an argument to compiler intrinsic type trait '__is_pod' with [ BidiIter=const char * ] ../STLPort/stlport\stl/pointers/_tools.h(79) : error C2027: use of undefined type 'boost::xpressive::match_results' with [ BidiIter=const char * ] ../STLPort/stlport\stl/pointers/_tools.h(79) : error C2227: left of '->{dtor}' must point to class/struct/union/generic type type is 'boost::xpressive::detail::match_state *const ' with [ BidiIter=const char * ] ../STLPort/stlport\stl/pointers/_tools.h(79) : fatal error C1903: unable to recover from previous error(s); stopping compilation }}} I assume the problem is that nested_results< BidiIter > template derives from std::list< match_results< BidiIter > >, but at this point match_results is not complete because the nested_results template is instantiated by match_results< BidiIter >::nested_results_ member variable. The Standard forbids to instantiate STL containers on incomplete types, so I guess, STLport has no issue here. Just in case you try to reproduce, I have these macros defined: _STLP_USE_TEMPLATE_EXPRESSION=1, _STLP_USE_PTR_SPECIALIZATIONS=1. ",Bugs,closed,Boost 1.40.0,xpressive,Boost 1.39.0,Showstopper,fixed,stlport xpressive,