Opened 12 years ago

Closed 10 years ago

#4372 closed Bugs (fixed)

spirit::info violates STL container requirements

Reported by: Andrey Semashev Owned by: Hartmut Kaiser
Milestone: Boost 1.44.0 Component: spirit
Version: Boost Release Branch Severity: Showstopper
Keywords: Cc:

Description

The spirit::info class contains member value which is a variant with std::list< info > as one of the possible values. This requires the compiler to instantiate std::list on a not-yet-complete type. This breaks compilation with STLPort, the build log is as follows:

C:\_Sources\STLPort\stlport\stl/type_traits.h(249) : error C2139: 'boost::spirit::info' : an undefined class is not allowed as an argument to compiler intrinsic type trait '__has_trivial_constructor'
        .\boost/spirit/home/support/info.hpp(30) : see declaration of 'boost::spirit::info'
        C:\_Sources\STLPort\stlport\stl/pointers/_tools.h(76) : see reference to class template instantiation 'stlp_std::__type_traits<_Tp>' being compiled
        with
        [
            _Tp=boost::spirit::info
        ]
        C:\_Sources\STLPort\stlport\stl/pointers/_list.h(61) : see reference to class template instantiation 'stlp_std::priv::_StorageType<_Tp>' being compiled
        with
        [
            _Tp=boost::spirit::info
        ]
        .\boost/mpl/sizeof.hpp(27) : see reference to class template instantiation 'stlp_std::list<_Tp>' being compiled
        with
        [
            _Tp=boost::spirit::info
        ]
        .\boost/mpl/aux_/has_type.hpp(20) : see reference to class template instantiation 'boost::mpl::sizeof_<T>' being compiled
        with
        [
            T=stlp_std::list<boost::spirit::info>
        ]
        .\boost/mpl/aux_/preprocessed/plain/quote.hpp(36) : see reference to class template instantiation 'boost::mpl::aux::has_type<T>' being compiled
        with
        [
            T=boost::mpl::sizeof_<stlp_std::list<boost::spirit::info>>
        ]
        .\boost/mpl/aux_/preprocessed/plain/apply_wrap.hpp(39) : see reference to class template instantiation 'boost::mpl::quote1<F,Tag>::apply<U1>' being compiled
        with
        [
            F=boost::mpl::sizeof_,
            Tag=boost::mpl::void_,
            U1=stlp_std::list<boost::spirit::info>
        ]
        .\boost/mpl/aux_/preprocessed/plain/bind.hpp(144) : see reference to class template instantiation 'boost::mpl::apply_wrap1<F,T1>' being compiled
        with
        [
            F=boost::mpl::quote1<boost::mpl::sizeof_,boost::mpl::void_>,
            T1=stlp_std::list<boost::spirit::info>
        ]
        .\boost/mpl/aux_/preprocessed/plain/apply_wrap.hpp(39) : see reference to class template instantiation 'boost::mpl::bind1<F,T1>::apply<U1>' being compiled
        with
        [
            F=boost::mpl::quote1<boost::mpl::sizeof_,boost::mpl::void_>,
            T1=boost::mpl::arg<1>,
            U1=stlp_std::list<boost::spirit::info>
        ]
        .\boost/mpl/aux_/preprocessed/plain/bind.hpp(144) : see reference to class template instantiation 'boost::mpl::apply_wrap1<F,T1>' being compiled
        with
        [
            F=boost::mpl::protect<boost::mpl::bind1<boost::mpl::quote1<boost::mpl::sizeof_,boost::mpl::void_>,boost::mpl::arg<1>>>,
            T1=stlp_std::list<boost::spirit::info>
        ]
        .\boost/mpl/aux_/preprocessed/plain/apply_wrap.hpp(80) : see reference to class template instantiation 'boost::mpl::bind1<F,T1>::apply<U1,U2,U3,U4,U5>' being compiled
        with
        [
            F=boost::mpl::protect<boost::mpl::bind1<boost::mpl::quote1<boost::mpl::sizeof_,boost::mpl::void_>,boost::mpl::arg<1>>>,
            T1=boost::mpl::_2,
            U1=boost::mpl::l_end,
            U2=stlp_std::list<boost::spirit::info>,
            U3=boost::mpl::na,
            U4=boost::mpl::na,
            U5=boost::mpl::na
        ]
        .\boost/mpl/aux_/preprocessed/plain/bind.hpp(160) : see reference to class template instantiation 'boost::mpl::apply_wrap5<F,T1,T2,T3,T4,T5>' being compiled
        with
        [
            F=boost::mpl::bind1<boost::mpl::protect<boost::mpl::bind1<boost::mpl::quote1<boost::mpl::sizeof_,boost::mpl::void_>,boost::mpl::arg<1>>>,boost::mpl::_2>,
            T1=boost::mpl::l_end,
            T2=stlp_std::list<boost::spirit::info>,
            T3=boost::mpl::na,
            T4=boost::mpl::na,
            T5=boost::mpl::na
        ]
        .\boost/mpl/aux_/preprocessed/plain/bind.hpp(206) : see reference to class template instantiation 'boost::mpl::aux::resolve_bind_arg<T,U1,U2,U3,U4,U5>' being compiled
        with
        [
            T=boost::mpl::bind1<boost::mpl::protect<boost::mpl::bind1<boost::mpl::quote1<boost::mpl::sizeof_,boost::mpl::void_>,boost::mpl::arg<1>>>,boost::mpl::_2>,
            U1=boost::mpl::l_end,
            U2=stlp_std::list<boost::spirit::info>,
            U3=boost::mpl::na,
            U4=boost::mpl::na,
            U5=boost::mpl::na
        ]
        .\boost/mpl/aux_/preprocessed/plain/apply_wrap.hpp(49) : see reference to class template instantiation 'boost::mpl::bind2<F,T1,T2>::apply<U1,U2>' being compiled
        with
        [
            F=boost::mpl::lambda<boost::mpl::push_front<boost::mpl::na,boost::mpl::na>>::type,
            T1=boost::mpl::_1,
            T2=boost::mpl::bind1<boost::mpl::protect<boost::mpl::bind1<boost::mpl::quote1<boost::mpl::sizeof_,boost::mpl::void_>,boost::mpl::arg<1>>>,boost::mpl::_2>,
            U1=boost::mpl::l_end,
            U2=stlp_std::list<boost::spirit::info>
        ]
        .\boost/mpl/aux_/preprocessed/plain/apply.hpp(63) : see reference to class template instantiation 'boost::mpl::apply_wrap2<F,T1,T2>' being compiled
        with
        [
            F=boost::mpl::bind2<boost::mpl::lambda<boost::mpl::push_front<boost::mpl::na,boost::mpl::na>>::type,boost::mpl::_1,boost::mpl::bind1<boost::mpl::protect<boost::mpl::bind1<boost::mpl::quote1<boost::mpl::sizeof_,boost::mpl::void_>,boost::mpl::arg<1>>>,boost::mpl::_2>>,
            T1=boost::mpl::l_end,
            T2=stlp_std::list<boost::spirit::info>
        ]
        .\boost/mpl/aux_/preprocessed/plain/reverse_fold_impl.hpp(58) : see reference to class template instantiation 'boost::mpl::apply2<F,T1,T2>' being compiled
        with
        [
            F=boost::mpl::bind2<boost::mpl::lambda<boost::mpl::push_front<boost::mpl::na,boost::mpl::na>>::type,boost::mpl::_1,boost::mpl::bind1<boost::mpl::protect<boost::mpl::bind1<boost::mpl::quote1<boost::mpl::sizeof_,boost::mpl::void_>,boost::mpl::arg<1>>>,boost::mpl::_2>>,
            T1=boost::mpl::l_end,
            T2=stlp_std::list<boost::spirit::info>
        ]
        .\boost/mpl/aux_/preprocessed/plain/reverse_fold_impl.hpp(181) : see reference to class template instantiation 'boost::mpl::aux::reverse_fold_impl<N,First,Last,State,BackwardOp,ForwardOp>' being compiled
        with
        [
            N=1,
            First=boost::mpl::l_iter<boost::mpl::l_item<boost::mpl::long_<1>,stlp_std::list<boost::spirit::info>,boost::mpl::l_end>>,
            Last=boost::mpl::l_iter<boost::mpl::l_end>,
            State=boost::mpl::l_end,
            BackwardOp=boost::mpl::bind2<boost::mpl::lambda<boost::mpl::push_front<boost::mpl::na,boost::mpl::na>>::type,boost::mpl::_1,boost::mpl::bind1<boost::mpl::protect<boost::mpl::bind1<boost::mpl::quote1<boost::mpl::sizeof_,boost::mpl::void_>,boost::mpl::arg<1>>>,boost::mpl::_2>>,
            ForwardOp=boost::mpl::arg<1>
        ]
        .\boost/mpl/reverse_fold.hpp(41) : see reference to class template instantiation 'boost::mpl::aux::reverse_fold_impl<N,First,Last,State,BackwardOp,ForwardOp>' being compiled
        with
        [
            N=5,
            First=boost::mpl::l_iter<boost::mpl::l_item<boost::mpl::long_<5>,boost::spirit::info::nil,boost::mpl::l_item<boost::mpl::long_<4>,stlp_std::basic_string<char,stlp_std::char_traits<char>,stlp_std::allocator<char>>,boost::mpl::l_item<boost::mpl::long_<3>,boost::recursive_wrapper<boost::spirit::info>,boost::mpl::l_item<boost::mpl::long_<2>,boost::recursive_wrapper<stlp_std::pair<boost::spirit::info,boost::spirit::info>>,boost::mpl::l_item<boost::mpl::long_<1>,stlp_std::list<boost::spirit::info>,boost::mpl::l_end>>>>>>,
            Last=boost::mpl::l_iter<boost::mpl::l_end>,
            State=boost::mpl::l_end,
            BackwardOp=boost::mpl::bind2<boost::mpl::lambda<boost::mpl::push_front<boost::mpl::na,boost::mpl::na>>::type,boost::mpl::_1,boost::mpl::bind1<boost::mpl::protect<boost::mpl::bind1<boost::mpl::quote1<boost::mpl::sizeof_,boost::mpl::void_>,boost::mpl::arg<1>>>,boost::mpl::_2>>,
            ForwardOp=boost::mpl::arg<1>
        ]
        .\boost/mpl/transform.hpp(65) : see reference to class template instantiation 'boost::mpl::reverse_fold<Sequence,State,BackwardOp>' being compiled
        with
        [
            Sequence=boost::mpl::l_item<boost::mpl::long_<5>,boost::spirit::info::nil,boost::mpl::l_item<boost::mpl::long_<4>,stlp_std::basic_string<char,stlp_std::char_traits<char>,stlp_std::allocator<char>>,boost::mpl::l_item<boost::mpl::long_<3>,boost::recursive_wrapper<boost::spirit::info>,boost::mpl::l_item<boost::mpl::long_<2>,boost::recursive_wrapper<stlp_std::pair<boost::spirit::info,boost::spirit::info>>,boost::mpl::l_item<boost::mpl::long_<1>,stlp_std::list<boost::spirit::info>,boost::mpl::l_end>>>>>,
            State=boost::mpl::l_end,
            BackwardOp=boost::mpl::bind2<boost::mpl::lambda<boost::mpl::push_front<boost::mpl::na,boost::mpl::na>>::type,boost::mpl::_1,boost::mpl::bind1<boost::mpl::protect<boost::mpl::bind1<boost::mpl::quote1<boost::mpl::sizeof_,boost::mpl::void_>,boost::mpl::arg<1>>>,boost::mpl::_2>>
        ]
        .\boost/mpl/transform.hpp(113) : see reference to class template instantiation 'boost::mpl::aux::reverse_transform1_impl<Seq,Op,In>' being compiled
        with
        [
            Seq=boost::mpl::l_item<boost::mpl::long_<5>,boost::spirit::info::nil,boost::mpl::l_item<boost::mpl::long_<4>,stlp_std::basic_string<char,stlp_std::char_traits<char>,stlp_std::allocator<char>>,boost::mpl::l_item<boost::mpl::long_<3>,boost::recursive_wrapper<boost::spirit::info>,boost::mpl::l_item<boost::mpl::long_<2>,boost::recursive_wrapper<stlp_std::pair<boost::spirit::info,boost::spirit::info>>,boost::mpl::l_item<boost::mpl::long_<1>,stlp_std::list<boost::spirit::info>,boost::mpl::l_end>>>>>,
            Op=boost::mpl::sizeof_<boost::mpl::_1>,
            In=boost::mpl::front_inserter<boost::mpl::clear_impl<boost::mpl::aux::list_tag>::apply<boost::mpl::list5<boost::spirit::info::nil,stlp_std::basic_string<char,stlp_std::char_traits<char>,stlp_std::allocator<char>>,boost::recursive_wrapper<boost::spirit::info>,boost::recursive_wrapper<stlp_std::pair<boost::spirit::info,boost::spirit::info>>,stlp_std::list<boost::spirit::info>>>::type>
        ]
        .\boost/variant/variant.hpp(121) : see reference to class template instantiation 'boost::mpl::transform1<P1,P2>' being compiled
        with
        [
            P1=boost::mpl::l_item<boost::mpl::long_<5>,boost::spirit::info::nil,boost::mpl::l_item<boost::mpl::long_<4>,stlp_std::basic_string<char,stlp_std::char_traits<char>,stlp_std::allocator<char>>,boost::mpl::l_item<boost::mpl::long_<3>,boost::recursive_wrapper<boost::spirit::info>,boost::mpl::l_item<boost::mpl::long_<2>,boost::recursive_wrapper<stlp_std::pair<boost::spirit::info,boost::spirit::info>>,boost::mpl::l_item<boost::mpl::long_<1>,stlp_std::list<boost::spirit::info>,boost::mpl::l_end>>>>>,
            P2=boost::mpl::sizeof_<boost::mpl::_1>
        ]
        .\boost/variant/variant.hpp(233) : see reference to class template instantiation 'boost::detail::variant::max_value<Sequence,F>' being compiled
        with
        [
            Sequence=boost::mpl::l_item<boost::mpl::long_<5>,boost::spirit::info::nil,boost::mpl::l_item<boost::mpl::long_<4>,stlp_std::basic_string<char,stlp_std::char_traits<char>,stlp_std::allocator<char>>,boost::mpl::l_item<boost::mpl::long_<3>,boost::recursive_wrapper<boost::spirit::info>,boost::mpl::l_item<boost::mpl::long_<2>,boost::recursive_wrapper<stlp_std::pair<boost::spirit::info,boost::spirit::info>>,boost::mpl::l_item<boost::mpl::long_<1>,stlp_std::list<boost::spirit::info>,boost::mpl::l_end>>>>>,
            F=boost::mpl::sizeof_<boost::mpl::_1>
        ]
        .\boost/variant/variant.hpp(1105) : see reference to class template instantiation 'boost::detail::variant::make_storage<Types,NeverUsesBackupFlag>' being compiled
        with
        [
            Types=boost::mpl::l_item<boost::mpl::long_<5>,boost::spirit::info::nil,boost::mpl::l_item<boost::mpl::long_<4>,stlp_std::basic_string<char,stlp_std::char_traits<char>,stlp_std::allocator<char>>,boost::mpl::l_item<boost::mpl::long_<3>,boost::recursive_wrapper<boost::spirit::info>,boost::mpl::l_item<boost::mpl::long_<2>,boost::recursive_wrapper<stlp_std::pair<boost::spirit::info,boost::spirit::info>>,boost::mpl::l_item<boost::mpl::long_<1>,stlp_std::list<boost::spirit::info>,boost::mpl::l_end>>>>>,
            NeverUsesBackupFlag=boost::variant<boost::spirit::info::nil,boost::spirit::utf8_string,boost::recursive_wrapper<boost::spirit::info>,boost::recursive_wrapper<stlp_std::pair<boost::spirit::info,boost::spirit::info>>,stlp_std::list<boost::spirit::info>>::has_fallback_type_
        ]
        .\boost/spirit/home/support/info.hpp(69) : see reference to class template instantiation 'boost::variant<T0_,T1,T2,T3,T4>' being compiled
        with
        [
            T0_=boost::spirit::info::nil,
            T1=boost::spirit::utf8_string,
            T2=boost::recursive_wrapper<boost::spirit::info>,
            T3=boost::recursive_wrapper<stlp_std::pair<boost::spirit::info,boost::spirit::info>>,
            T4=stlp_std::list<boost::spirit::info>
        ]
C:\_Sources\STLPort\stlport\stl/type_traits.h(250) : error C2139: 'boost::spirit::info' : an undefined class is not allowed as an argument to compiler intrinsic type trait '__has_trivial_copy'
        .\boost/spirit/home/support/info.hpp(30) : see declaration of 'boost::spirit::info'
C:\_Sources\STLPort\stlport\stl/type_traits.h(251) : error C2139: 'boost::spirit::info' : an undefined class is not allowed as an argument to compiler intrinsic type trait '__has_trivial_assign'
        .\boost/spirit/home/support/info.hpp(30) : see declaration of 'boost::spirit::info'
C:\_Sources\STLPort\stlport\stl/type_traits.h(252) : error C2139: 'boost::spirit::info' : an undefined class is not allowed as an argument to compiler intrinsic type trait '__has_trivial_destructor'
        .\boost/spirit/home/support/info.hpp(30) : see declaration of 'boost::spirit::info'
C:\_Sources\STLPort\stlport\stl/type_traits.h(253) : error C2139: 'boost::spirit::info' : an undefined class is not allowed as an argument to compiler intrinsic type trait '__is_pod'
        .\boost/spirit/home/support/info.hpp(30) : see declaration of 'boost::spirit::info'

Change History (8)

comment:1 by Steven Watanabe, 12 years ago

This looks similar to #1610.

in reply to:  1 ; comment:2 by Hartmut Kaiser, 12 years ago

Replying to steven_watanabe:

This looks similar to #1610.

Yes, same symptoms, but completely unrelated, different cause.

in reply to:  2 comment:3 by Andrey Semashev, 12 years ago

Replying to hkaiser:

Replying to steven_watanabe:

This looks similar to #1610.

Yes, same symptoms, but completely unrelated, different cause.

...and #1610 appears to be for Spirit.Classic while this one is for Spirit2.

comment:4 by anonymous, 10 years ago

This also fails with clang C++11 and Apple's libc++.

comment:5 by Mehmet Ozan Kabak, 10 years ago

Just wrapping that std::list in a recursive_wrapper seems to solve the issue, at least with Apple LLVM Compiler 4.0 / libc++ on a Mac OS X.

in reply to:  5 ; comment:6 by Hartmut Kaiser, 10 years ago

Replying to Mehmet Ozan Kabak:

Just wrapping that std::list in a recursive_wrapper seems to solve the issue, at least with Apple LLVM Compiler 4.0 / libc++ on a Mac OS X.

Would you care to submit a patch? I'd love to apply it, if it resolves the issue.

in reply to:  6 comment:7 by Mehmet Ozan Kabak, 10 years ago

Replying to hkaiser:

Would you care to submit a patch? I'd love to apply it, if it resolves the issue.

Will do.

comment:8 by Hartmut Kaiser, 10 years ago

Resolution: fixed
Status: newclosed

(In [80121]) Fix #4372: spirit::info violates STL container requirements

Note: See TracTickets for help on using tickets.