[Boost-bugs] [Boost C++ Libraries] #2402: boost::spirit (boost-1.36.0) parsers fail to compile on MSVS 9.0 with struct member alignment being set to 1 byte

Subject: [Boost-bugs] [Boost C++ Libraries] #2402: boost::spirit (boost-1.36.0) parsers fail to compile on MSVS 9.0 with struct member alignment being set to 1 byte
From: Boost C++ Libraries (noreply_at_[hidden])
Date: 2008-10-10 07:39:16


#2402: boost::spirit (boost-1.36.0) parsers fail to compile on MSVS 9.0 with
struct member alignment being set to 1 byte
----------------------------------+-----------------------------------------
 Reporter: slava_at_[hidden] | Owner: djowel
     Type: Bugs | Status: new
Milestone: Boost 1.37.0 | Component: spirit
  Version: Boost 1.36.0 | Severity: Problem
 Keywords: |
----------------------------------+-----------------------------------------
 When I try to compile the following code with MSVS 9.0 and boost-1.36.0
 with struct member alignment being set to 1 byte, it fails with
 boost::STATIC_ASSERTION_FAILURE

 The code:

 {{{
 parse_info<std::wstring::const_iterator> pi= parse(SrchNM.begin(),
 SrchNM.end(),
                         as_lower_d[
                         !(str_p("w/"))[assign_a(prefix_is_w, true)]
 //prefix
>> !list_p(
                                 (+(anychar_p - '=' - ',' -
 '@'))[assign_a(last_attr_name)]
>> '='
>> (+(anychar_p - '=' - ',' -
 '@'))[MapInserter<StrMap>(srch_attrs, last_attr_name)]
                                 ,
                                 ','
                                 )
>> !ch_p('@')
>> (*anychar_p)[assign_a(srch_word)]
                         ]);
 }}}

 The errors reported:

 {{{
 1>d:\users\slava\etap\external\boost\boost\type_traits\type_with_alignment.hpp(206)
 : error C2027: use of undefined type 'boost::STATIC_ASSERTION_FAILURE<x>'
 1> with
 1> [
 1> x=false
 1> ]
 1>
 d:\users\slava\etap\external\boost\boost\type_traits\type_with_alignment.hpp(218)
 : see reference to class template instantiation
 'boost::detail::type_with_alignment_imp<Align>' being compiled
 1> with
 1> [
 1> Align=2
 1> ]
 1>
 d:\users\slava\etap\external\boost\boost\optional\optional.hpp(112) : see
 reference to class template instantiation
 'boost::type_with_alignment<Align>' being compiled
 1> with
 1> [
 1> Align=2
 1> ]
 1>
 d:\users\slava\etap\external\boost\boost\optional\optional.hpp(113) : see
 reference to class template instantiation
 'boost::optional_detail::aligned_storage<T>::dummy_u' being compiled
 1> with
 1> [
 1> T=unsigned short
 1> ]
 1>
 d:\users\slava\etap\external\boost\boost\optional\optional.hpp(448) : see
 reference to class template instantiation
 'boost::optional_detail::aligned_storage<T>' being compiled
 1> with
 1> [
 1> T=unsigned short
 1> ]
 1>
 d:\users\slava\etap\external\boost\boost\optional\optional.hpp(455) : see
 reference to class template instantiation
 'boost::optional_detail::optional_base<T>' being compiled
 1> with
 1> [
 1> T=unsigned short
 1> ]
 1>
 d:\users\slava\etap\external\boost\boost\spirit\home\classic\core\match.hpp(69)
 : see reference to class template instantiation 'boost::optional<T>' being
 compiled
 1> with
 1> [
 1> T=unsigned short
 1> ]
 1>
 d:\users\slava\etap\external\boost\boost\spirit\home\classic\core\composite\optional.hpp(56)
 : see reference to class template instantiation 'boost::spirit::match<T>'
 being compiled
 1> with
 1> [
 1> T=unsigned short
 1> ]
 1>
 d:\users\slava\etap\external\boost\boost\spirit\home\classic\core\composite\sequence.hpp(56)
 : see reference to function template instantiation
 'boost::spirit::match<boost::spirit::nil_t>
 boost::spirit::optional<S>::parse<ScannerT>(const ScannerT &) const' being
 compiled
 1> with
 1> [
 1> S=boost::spirit::chlit<char>,
 1>
 ScannerT=boost::spirit::scanner<std::_String_iterator<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t>>,boost::spirit::scanner_policies<boost::spirit::inhibit_case_iteration_policy<boost::spirit::iteration_policy>,boost::spirit::match_policy,boost::spirit::action_policy>>
 1> ]
 1>
 d:\users\slava\etap\external\boost\boost\spirit\home\classic\core\composite\sequence.hpp(55)
 : see reference to function template instantiation
 'boost::spirit::match<boost::spirit::nil_t>
 boost::spirit::sequence<A,B>::parse<ScannerT>(const ScannerT &) const'
 being compiled
 1> with
 1> [
 1>
 A=boost::spirit::sequence<boost::spirit::optional<boost::spirit::action<boost::spirit::strlit<const
 char
 *>,boost::spirit::ref_const_ref_actor<bool,bool,boost::spirit::assign_action>>>,boost::spirit::optional<boost::spirit::list_parser<boost::spirit::sequence<boost::spirit::sequence<boost::spirit::action<boost::spirit::positive<boost::spirit::difference<boost::spirit::difference<boost::spirit::difference<boost::spirit::anychar_parser,boost::spirit::chlit<char>>,boost::spirit::chlit<char>>,boost::spirit::chlit<char>>>,boost::spirit::ref_value_actor<std::wstring,boost::spirit::assign_action>>,boost::spirit::chlit<char>>,boost::spirit::action<boost::spirit::positive<boost::spirit::difference<boost::spirit::difference<boost::spirit::difference<boost::spirit::anychar_parser,boost::spirit::chlit<char>>,boost::spirit::chlit<char>>,boost::spirit::chlit<char
>>>,`anonymous-
 namespace'::MapInserter<StrMap>>>,boost::spirit::chlit<char>,boost::spirit::no_list_endtoken,boost::spirit::binary_parser_category>>>,
 1> B=boost::spirit::optional<boost::spirit::chlit<char>>,
 1>
 ScannerT=boost::spirit::scanner<std::_String_iterator<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t>>,boost::spirit::scanner_policies<boost::spirit::inhibit_case_iteration_policy<boost::spirit::iteration_policy>,boost::spirit::match_policy,boost::spirit::action_policy>>
 1> ]
 1>
 d:\users\slava\etap\external\boost\boost\spirit\home\classic\core\composite\impl\directives.ipp(141)
 : see reference to function template instantiation
 'boost::spirit::match<boost::spirit::nil_t>
 boost::spirit::sequence<A,B>::parse<boost::spirit::scanner<IteratorT,PoliciesT>>(const
 ScannerT &) const' being compiled
 1> with
 1> [
 1>
 A=boost::spirit::sequence<boost::spirit::sequence<boost::spirit::optional<boost::spirit::action<boost::spirit::strlit<const
 char
 *>,boost::spirit::ref_const_ref_actor<bool,bool,boost::spirit::assign_action>>>,boost::spirit::optional<boost::spirit::list_parser<boost::spirit::sequence<boost::spirit::sequence<boost::spirit::action<boost::spirit::positive<boost::spirit::difference<boost::spirit::difference<boost::spirit::difference<boost::spirit::anychar_parser,boost::spirit::chlit<char>>,boost::spirit::chlit<char>>,boost::spirit::chlit<char>>>,boost::spirit::ref_value_actor<std::wstring,boost::spirit::assign_action>>,boost::spirit::chlit<char>>,boost::spirit::action<boost::spirit::positive<boost::spirit::difference<boost::spirit::difference<boost::spirit::difference<boost::spirit::anychar_parser,boost::spirit::chlit<char>>,boost::spirit::chlit<char>>,boost::spirit::chlit<char
>>>,`anonymous-
 namespace'::MapInserter<StrMap>>>,boost::spirit::chlit<char>,boost::spirit::no_list_endtoken,boost::spirit::binary_parser_category>>>,boost::spirit::optional<boost::spirit::chlit<char>>>,
 1>
 B=boost::spirit::action<boost::spirit::kleene_star<boost::spirit::anychar_parser>,boost::spirit::ref_value_actor<std::wstring,boost::spirit::assign_action>>,
 1>
 IteratorT=std::_String_iterator<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t>>,
 1>
 PoliciesT=boost::spirit::scanner_policies<boost::spirit::inhibit_case_iteration_policy<boost::spirit::iteration_policy>,boost::spirit::match_policy,boost::spirit::action_policy>,
 1>
 ScannerT=boost::spirit::scanner<std::_String_iterator<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t>>,boost::spirit::scanner_policies<boost::spirit::inhibit_case_iteration_policy<boost::spirit::iteration_policy>,boost::spirit::match_policy,boost::spirit::action_policy>>
 1> ]
 1>
 d:\users\slava\etap\external\boost\boost\spirit\home\classic\core\composite\directives.hpp(163)
 : see reference to function template instantiation 'RT
 boost::spirit::impl::inhibit_case_parser_parse<result_t,T,ScannerT>(const
 ST &,const ScannerT &,const boost::spirit::iteration_policy &)' being
 compiled
 1> with
 1> [
 1> RT=result_t,
 1>
 T=boost::spirit::sequence<boost::spirit::sequence<boost::spirit::sequence<boost::spirit::optional<boost::spirit::action<boost::spirit::strlit<const
 char
 *>,boost::spirit::ref_const_ref_actor<bool,bool,boost::spirit::assign_action>>>,boost::spirit::optional<boost::spirit::list_parser<boost::spirit::sequence<boost::spirit::sequence<boost::spirit::action<boost::spirit::positive<boost::spirit::difference<boost::spirit::difference<boost::spirit::difference<boost::spirit::anychar_parser,boost::spirit::chlit<char>>,boost::spirit::chlit<char>>,boost::spirit::chlit<char>>>,boost::spirit::ref_value_actor<std::wstring,boost::spirit::assign_action>>,boost::spirit::chlit<char>>,boost::spirit::action<boost::spirit::positive<boost::spirit::difference<boost::spirit::difference<boost::spirit::difference<boost::spirit::anychar_parser,boost::spirit::chlit<char>>,boost::spirit::chlit<char>>,boost::spirit::chlit<char
>>>,`anonymous-
 namespace'::MapInserter<StrMap>>>,boost::spirit::chlit<char>,boost::spirit::no_list_endtoken,boost::spirit::binary_parser_category>>>,boost::spirit::optional<boost::spirit::chlit<char>>>,boost::spirit::action<boost::spirit::kleene_star<boost::spirit::anychar_parser>,boost::spirit::ref_value_actor<std::wstring,boost::spirit::assign_action>>>,
 1>
 ScannerT=boost::spirit::scanner<std::_String_iterator<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t>>,boost::spirit::scanner_policies<>>,
 1>
 ST=boost::spirit::sequence<boost::spirit::sequence<boost::spirit::sequence<boost::spirit::optional<boost::spirit::action<boost::spirit::strlit<const
 char
 *>,boost::spirit::ref_const_ref_actor<bool,bool,boost::spirit::assign_action>>>,boost::spirit::optional<boost::spirit::list_parser<boost::spirit::sequence<boost::spirit::sequence<boost::spirit::action<boost::spirit::positive<boost::spirit::difference<boost::spirit::difference<boost::spirit::difference<boost::spirit::anychar_parser,boost::spirit::chlit<char>>,boost::spirit::chlit<char>>,boost::spirit::chlit<char>>>,boost::spirit::ref_value_actor<std::wstring,boost::spirit::assign_action>>,boost::spirit::chlit<char>>,boost::spirit::action<boost::spirit::positive<boost::spirit::difference<boost::spirit::difference<boost::spirit::difference<boost::spirit::anychar_parser,boost::spirit::chlit<char>>,boost::spirit::chlit<char>>,boost::spirit::chlit<char
>>>,`anonymous-
 namespace'::MapInserter<StrMap>>>,boost::spirit::chlit<char>,boost::spirit::no_list_endtoken,boost::spirit::binary_parser_category>>>,boost::spirit::optional<boost::spirit::chlit<char>>>,boost::spirit::action<boost::spirit::kleene_star<boost::spirit::anychar_parser>,boost::spirit::ref_value_actor<std::wstring,boost::spirit::assign_action>>>
 1> ]
 1>
 d:\users\slava\etap\external\boost\boost\spirit\home\classic\core\impl\parser.ipp(30)
 : see reference to function template instantiation
 'boost::spirit::match<boost::spirit::nil_t>
 boost::spirit::inhibit_case<ParserT>::parse<boost::spirit::scanner<IteratorT,PoliciesT>>(const
 ScannerT &) const' being compiled
 1> with
 1> [
 1>
 ParserT=boost::spirit::sequence<boost::spirit::sequence<boost::spirit::sequence<boost::spirit::optional<boost::spirit::action<boost::spirit::strlit<const
 char
 *>,boost::spirit::ref_const_ref_actor<bool,bool,boost::spirit::assign_action>>>,boost::spirit::optional<boost::spirit::list_parser<boost::spirit::sequence<boost::spirit::sequence<boost::spirit::action<boost::spirit::positive<boost::spirit::difference<boost::spirit::difference<boost::spirit::difference<boost::spirit::anychar_parser,boost::spirit::chlit<char>>,boost::spirit::chlit<char>>,boost::spirit::chlit<char>>>,boost::spirit::ref_value_actor<std::wstring,boost::spirit::assign_action>>,boost::spirit::chlit<char>>,boost::spirit::action<boost::spirit::positive<boost::spirit::difference<boost::spirit::difference<boost::spirit::difference<boost::spirit::anychar_parser,boost::spirit::chlit<char>>,boost::spirit::chlit<char>>,boost::spirit::chlit<char
>>>,`anonymous-
 namespace'::MapInserter<StrMap>>>,boost::spirit::chlit<char>,boost::spirit::no_list_endtoken,boost::spirit::binary_parser_category>>>,boost::spirit::optional<boost::spirit::chlit<char>>>,boost::spirit::action<boost::spirit::kleene_star<boost::spirit::anychar_parser>,boost::spirit::ref_value_actor<std::wstring,boost::spirit::assign_action>>>,
 1>
 IteratorT=std::_String_iterator<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t>>,
 1> PoliciesT=boost::spirit::scanner_policies<>,
 1>
 ScannerT=boost::spirit::scanner<std::_String_iterator<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t>>,boost::spirit::scanner_policies<>>
 1> ]
 1> d:\users\slava\etap\projects\tagged\tgtproc\tgtproc.cpp(1329) :
 see reference to function template instantiation
 'boost::spirit::parse_info<IteratorT>
 boost::spirit::parse<std::_String_iterator<_Elem,_Traits,_Alloc>,boost::spirit::inhibit_case<ParserT>>(const
 IteratorT &,const IteratorT &,const boost::spirit::parser<DerivedT> &)'
 being compiled
 1> with
 1> [
 1>
 IteratorT=std::_String_iterator<wchar_t,std::char_traits<wchar_t>,std::allocator<wchar_t>>,
 1> _Elem=wchar_t,
 1> _Traits=std::char_traits<wchar_t>,
 1> _Alloc=std::allocator<wchar_t>,
 1>
 ParserT=boost::spirit::sequence<boost::spirit::sequence<boost::spirit::sequence<boost::spirit::optional<boost::spirit::action<boost::spirit::strlit<const
 char
 *>,boost::spirit::ref_const_ref_actor<bool,bool,boost::spirit::assign_action>>>,boost::spirit::optional<boost::spirit::list_parser<boost::spirit::sequence<boost::spirit::sequence<boost::spirit::action<boost::spirit::positive<boost::spirit::difference<boost::spirit::difference<boost::spirit::difference<boost::spirit::anychar_parser,boost::spirit::chlit<char>>,boost::spirit::chlit<char>>,boost::spirit::chlit<char>>>,boost::spirit::ref_value_actor<std::wstring,boost::spirit::assign_action>>,boost::spirit::chlit<char>>,boost::spirit::action<boost::spirit::positive<boost::spirit::difference<boost::spirit::difference<boost::spirit::difference<boost::spirit::anychar_parser,boost::spirit::chlit<char>>,boost::spirit::chlit<char>>,boost::spirit::chlit<char
>>>,`anonymous-
 namespace'::MapInserter<StrMap>>>,boost::spirit::chlit<char>,boost::spirit::no_list_endtoken,boost::spirit::binary_parser_category>>>,boost::spirit::optional<boost::spirit::chlit<char>>>,boost::spirit::action<boost::spirit::kleene_star<boost::spirit::anychar_parser>,boost::spirit::ref_value_actor<std::wstring,boost::spirit::assign_action>>>,
 1>
 DerivedT=boost::spirit::inhibit_case<boost::spirit::sequence<boost::spirit::sequence<boost::spirit::sequence<boost::spirit::optional<boost::spirit::action<boost::spirit::strlit<const
 char
 *>,boost::spirit::ref_const_ref_actor<bool,bool,boost::spirit::assign_action>>>,boost::spirit::optional<boost::spirit::list_parser<boost::spirit::sequence<boost::spirit::sequence<boost::spirit::action<boost::spirit::positive<boost::spirit::difference<boost::spirit::difference<boost::spirit::difference<boost::spirit::anychar_parser,boost::spirit::chlit<char>>,boost::spirit::chlit<char>>,boost::spirit::chlit<char>>>,boost::spirit::ref_value_actor<std::wstring,boost::spirit::assign_action>>,boost::spirit::chlit<char>>,boost::spirit::action<boost::spirit::positive<boost::spirit::difference<boost::spirit::difference<boost::spirit::difference<boost::spirit::anychar_parser,boost::spirit::chlit<char>>,boost::spirit::chlit<char>>,boost::spirit::chlit<char
>>>,`anonymous-
 namespace'::MapInserter<StrMap>>>,boost::spirit::chlit<char>,boost::spirit::no_list_endtoken,boost::spirit::binary_parser_category>>>,boost::spirit::optional<boost::spirit::chlit<char>>>,boost::spirit::action<boost::spirit::kleene_star<boost::spirit::anychar_parser>,boost::spirit::ref_value_actor<std::wstring,boost::spirit::assign_action>>>>
 1> ]
 1>d:\users\slava\etap\external\boost\boost\type_traits\type_with_alignment.hpp(207)
 : error C2027: use of undefined type 'boost::STATIC_ASSERTION_FAILURE<x>'
 1> with
 1> [
 1> x=false
 1> ]
 }}}

 Increasing struct member alignment to 2 or more bytes solves the problem.
 The same code gives no errors with boost-1.35.0 even with alignment=1byte.

-- 
Ticket URL: <http://svn.boost.org/trac/boost/ticket/2402>
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:58 UTC