[committed] libstdc++: Implement string_view range constructor for C++23

Patrick Palka ppalka@redhat.com
Tue Apr 27 17:51:58 GMT 2021


On Tue, 27 Apr 2021, Jonathan Wakely via Libstdc++ wrote:

> On 27/04/21 16:34 +0200, Stephan Bergmann wrote:
> > On 23/03/2021 00:16, Jonathan Wakely via Gcc-patches wrote:
> > > This implements the new string_view constructor proposed by P1989R2.
> > > This hasn't been voted into the C++23 draft yet, but it's been reviewed
> > > by LWG and is expected to be approved at the next WG21 meeting.
> > > 
> > > libstdc++-v3/ChangeLog:
> > > 
> > > 	* include/std/string_view (basic_string_view(Range&&)): Define new
> > > 	constructor and deduction guide.
> > > 	* testsuite/21_strings/basic_string_view/cons/char/range_c++20.cc: New
> > > test.
> > > 	* testsuite/21_strings/basic_string_view/cons/wchar_t/range_c++20.cc:
> > > New test.
> > > 
> > > Tested powerpc64le-linux. Committed to trunk.
> > > 
> > > (I wrote "C++20" in the commit log summary but it's a C++23 feature,
> > > which is why I'm confortable pushing it now in stage 4.)
> > 
> > I observe that with this change, recent Clang 13 trunk with -std=c++2b
> > starts to fail on Boost's boost/spirit/include/qi.hpp (at least both Boost
> > 1.73 and 1.75).  I unfortunately wasn't able to reduce this to a reasonably
> > small testcase, and have no idea whether its a Clang, libstdc++, or a even
> > Boost issue.
> 
> Thanks for the heads up.
> 
> I think this is a recursive constraint problem, where the new
> constructor participates in overload resolution so we try to satisfy
> its constraints, but those constraints depend on the thing that caused
> us to attempt overload resolution for that constructor.
> 
> But it's not obvious from the errors what triggers that.

It could be a manifestation of the Clang concepts bug
https://bugs.llvm.org/show_bug.cgi?id=44833 -- Clang apparently doesn't
perform deferred substitution into constraints.

> 
> > > $ cat test.cc
> > > #include "boost/spirit/include/qi.hpp"
> > 
> > > $ ~/llvm/trunk/inst/bin/clang++ --gcc-toolchain=~/gcc/trunk/inst
> > > -std=c++2b -fsyntax-only test.cc
> > > In file included from test.cc:1:
> > > In file included from /usr/include/boost/spirit/include/qi.hpp:16:
> > > In file included from /usr/include/boost/spirit/home/qi.hpp:14:
> > > In file included from /usr/include/boost/spirit/home/qi/action.hpp:14:
> > > In file included from
> > > /usr/include/boost/spirit/home/qi/action/action.hpp:14:
> > > In file included from
> > > /usr/include/boost/spirit/home/qi/meta_compiler.hpp:14:
> > > In file included from
> > > /usr/include/boost/spirit/home/support/meta_compiler.hpp:17:
> > > In file included from
> > > /usr/include/boost/spirit/home/support/make_component.hpp:15:
> > > In file included from
> > > /usr/include/boost/spirit/home/support/detail/make_cons.hpp:16:
> > > In file included from /usr/include/boost/fusion/include/cons.hpp:10:
> > > In file included from /usr/include/boost/fusion/support/config.hpp:13:
> > > In file included from
> > > ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/11.0.1/../../../../include/c++/11.0.1/utility:70:
> > > ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/11.0.1/../../../../include/c++/11.0.1/bits/stl_pair.h:217:11:
> > > error: field has incomplete type 'boost::spirit::info'
> > >      _T1 first;                 ///< The first member
> > >          ^
> > > ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/11.0.1/../../../../include/c++/11.0.1/bits/iterator_concepts.h:949:29:
> > > note: in instantiation of template class 'std::pair<boost::spirit::info,
> > > boost::spirit::info>' requested here
> > >          { __detail::__decay_copy(begin(__t)) } ->
> > > input_or_output_iterator;
> > >                                   ^
> > > ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/11.0.1/../../../../include/c++/11.0.1/bits/iterator_concepts.h:949:6:
> > > note: in instantiation of requirement here
> > >          { __detail::__decay_copy(begin(__t)) } ->
> > > input_or_output_iterator;
> > >            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > > ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/11.0.1/../../../../include/c++/11.0.1/bits/iterator_concepts.h:947:5:
> > > note: while substituting template arguments into constraint expression
> > > here
> > >        && requires(_Tp& __t)
> > >           ^~~~~~~~~~~~~~~~~~
> > > ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/11.0.1/../../../../include/c++/11.0.1/bits/ranges_base.h:115:7:
> > > note: while checking the satisfaction of concept '__adl_begin<const
> > > boost::recursive_wrapper<std::pair<boost::spirit::info,
> > > boost::spirit::info>> &>' requested here
> > >          || __adl_begin<_Tp>
> > >             ^~~~~~~~~~~~~~~~
> > > ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/11.0.1/../../../../include/c++/11.0.1/bits/ranges_base.h:115:7:
> > > note: while substituting template arguments into constraint expression
> > > here
> > >          || __adl_begin<_Tp>
> > >             ^~~~~~~~~~~~~~~~
> > > ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/11.0.1/../../../../include/c++/11.0.1/bits/ranges_base.h:581:2:
> > > note: (skipping 83 contexts in backtrace; use -ftemplate-backtrace-limit=0
> > > to see all)
> > >        ranges::begin(__t);
> > >        ^
> > > /usr/include/boost/mpl/aux_/preprocessed/gcc/and.hpp:50:7: note: in
> > > instantiation of template class 'boost::mpl::aux::and_impl<true,
> > > boost::mpl::not_<boost::is_const<boost::variant<boost::spirit::info::nil_,
> > > std::basic_string<char>, boost::recursive_wrapper<boost::spirit::info>,
> > > boost::recursive_wrapper<std::pair<boost::spirit::info,
> > > boost::spirit::info>>,
> > > boost::recursive_wrapper<std::list<boost::spirit::info>>>>>,
> > > boost::detail::variant::is_variant_constructible_from<boost::variant<boost::spirit::info::nil_,
> > > std::basic_string<char>, boost::recursive_wrapper<boost::spirit::info>,
> > > boost::recursive_wrapper<std::pair<boost::spirit::info,
> > > boost::spirit::info>>,
> > > boost::recursive_wrapper<std::list<boost::spirit::info>>> &&,
> > > boost::mpl::l_item<mpl_::long_<5>, boost::spirit::info::nil_,
> > > boost::mpl::l_item<mpl_::long_<4>, std::basic_string<char>,
> > > boost::mpl::l_item<mpl_::long_<3>,
> > > boost::recursive_wrapper<boost::spirit::info>,
> > > boost::mpl::l_item<mpl_::long_<2>,
> > > boost::recursive_wrapper<std::pair<boost::spirit::info,
> > > boost::spirit::info>>, boost::mpl::l_item<mpl_::long_<1>,
> > > boost::recursive_wrapper<std::list<boost::spirit::info>>,
> > > boost::mpl::l_end>>>>>>, mpl_::bool_<true>, mpl_::bool_<true>>' requested
> > > here
> > >    : aux::and_impl<
> > >      ^
> > > /usr/include/boost/core/enable_if.hpp:41:41: note: in instantiation of
> > > template class
> > > 'boost::mpl::and_<boost::is_rvalue_reference<boost::variant<boost::spirit::info::nil_,
> > > std::basic_string<char>, boost::recursive_wrapper<boost::spirit::info>,
> > > boost::recursive_wrapper<std::pair<boost::spirit::info,
> > > boost::spirit::info>>,
> > > boost::recursive_wrapper<std::list<boost::spirit::info>>> &&>,
> > > boost::mpl::not_<boost::is_const<boost::variant<boost::spirit::info::nil_,
> > > std::basic_string<char>, boost::recursive_wrapper<boost::spirit::info>,
> > > boost::recursive_wrapper<std::pair<boost::spirit::info,
> > > boost::spirit::info>>,
> > > boost::recursive_wrapper<std::list<boost::spirit::info>>>>>,
> > > boost::detail::variant::is_variant_constructible_from<boost::variant<boost::spirit::info::nil_,
> > > std::basic_string<char>, boost::recursive_wrapper<boost::spirit::info>,
> > > boost::recursive_wrapper<std::pair<boost::spirit::info,
> > > boost::spirit::info>>,
> > > boost::recursive_wrapper<std::list<boost::spirit::info>>> &&,
> > > boost::mpl::l_item<mpl_::long_<5>, boost::spirit::info::nil_,
> > > boost::mpl::l_item<mpl_::long_<4>, std::basic_string<char>,
> > > boost::mpl::l_item<mpl_::long_<3>,
> > > boost::recursive_wrapper<boost::spirit::info>,
> > > boost::mpl::l_item<mpl_::long_<2>,
> > > boost::recursive_wrapper<std::pair<boost::spirit::info,
> > > boost::spirit::info>>, boost::mpl::l_item<mpl_::long_<1>,
> > > boost::recursive_wrapper<std::list<boost::spirit::info>>,
> > > boost::mpl::l_end>>>>>>>' requested here
> > >  struct enable_if : public enable_if_c<Cond::value, T> {};
> > >                                        ^
> > > /usr/include/boost/variant/variant.hpp:2136:21: note: in instantiation of
> > > template class
> > > 'boost::enable_if<boost::mpl::and_<boost::is_rvalue_reference<boost::variant<boost::spirit::info::nil_,
> > > std::basic_string<char>, boost::recursive_wrapper<boost::spirit::info>,
> > > boost::recursive_wrapper<std::pair<boost::spirit::info,
> > > boost::spirit::info>>,
> > > boost::recursive_wrapper<std::list<boost::spirit::info>>> &&>,
> > > boost::mpl::not_<boost::is_const<boost::variant<boost::spirit::info::nil_,
> > > std::basic_string<char>, boost::recursive_wrapper<boost::spirit::info>,
> > > boost::recursive_wrapper<std::pair<boost::spirit::info,
> > > boost::spirit::info>>,
> > > boost::recursive_wrapper<std::list<boost::spirit::info>>>>>,
> > > boost::detail::variant::is_variant_constructible_from<boost::variant<boost::spirit::info::nil_,
> > > std::basic_string<char>, boost::recursive_wrapper<boost::spirit::info>,
> > > boost::recursive_wrapper<std::pair<boost::spirit::info,
> > > boost::spirit::info>>,
> > > boost::recursive_wrapper<std::list<boost::spirit::info>>> &&,
> > > boost::mpl::l_item<mpl_::long_<5>, boost::spirit::info::nil_,
> > > boost::mpl::l_item<mpl_::long_<4>, std::basic_string<char>,
> > > boost::mpl::l_item<mpl_::long_<3>,
> > > boost::recursive_wrapper<boost::spirit::info>,
> > > boost::mpl::l_item<mpl_::long_<2>,
> > > boost::recursive_wrapper<std::pair<boost::spirit::info,
> > > boost::spirit::info>>, boost::mpl::l_item<mpl_::long_<1>,
> > > boost::recursive_wrapper<std::list<boost::spirit::info>>,
> > > boost::mpl::l_end>>>>>>>, boost::variant<boost::spirit::info::nil_,
> > > std::basic_string<char>, boost::recursive_wrapper<boost::spirit::info>,
> > > boost::recursive_wrapper<std::pair<boost::spirit::info,
> > > boost::spirit::info>>,
> > > boost::recursive_wrapper<std::list<boost::spirit::info>>> &>' requested
> > > here
> > >    typename boost::enable_if<
> > >                    ^
> > > /usr/include/boost/variant/variant.hpp:1105:7: note: while substituting
> > > deduced template arguments into function template 'operator=' [with T =
> > > boost::variant<boost::spirit::info::nil_, std::basic_string<char>,
> > > boost::recursive_wrapper<boost::spirit::info>,
> > > boost::recursive_wrapper<std::pair<boost::spirit::info,
> > > boost::spirit::info>>,
> > > boost::recursive_wrapper<std::list<boost::spirit::info>>>]
> > > class variant
> > >      ^
> > > /usr/include/boost/spirit/home/support/info.hpp:29:12: note: while
> > > declaring the implicit move assignment operator for 'info'
> > >    struct info
> > >           ^
> > > /usr/include/boost/spirit/home/support/info.hpp:29:12: note: definition of
> > > 'boost::spirit::info' is not complete until the closing '}'
> > > In file included from test.cc:1:
> > > In file included from /usr/include/boost/spirit/include/qi.hpp:16:
> > > In file included from /usr/include/boost/spirit/home/qi.hpp:14:
> > > In file included from /usr/include/boost/spirit/home/qi/action.hpp:14:
> > > In file included from
> > > /usr/include/boost/spirit/home/qi/action/action.hpp:14:
> > > In file included from
> > > /usr/include/boost/spirit/home/qi/meta_compiler.hpp:14:
> > > In file included from
> > > /usr/include/boost/spirit/home/support/meta_compiler.hpp:17:
> > > In file included from
> > > /usr/include/boost/spirit/home/support/make_component.hpp:15:
> > > In file included from
> > > /usr/include/boost/spirit/home/support/detail/make_cons.hpp:16:
> > > In file included from /usr/include/boost/fusion/include/cons.hpp:10:
> > > In file included from /usr/include/boost/fusion/support/config.hpp:13:
> > > In file included from
> > > ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/11.0.1/../../../../include/c++/11.0.1/utility:70:
> > > ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/11.0.1/../../../../include/c++/11.0.1/bits/stl_pair.h:218:11:
> > > error: field has incomplete type 'boost::spirit::info'
> > >      _T2 second;                ///< The second member
> > >          ^
> > > /usr/include/boost/spirit/home/support/info.hpp:29:12: note: definition of
> > > 'boost::spirit::info' is not complete until the closing '}'
> > >    struct info
> > >           ^
> > > In file included from test.cc:1:
> > > In file included from /usr/include/boost/spirit/include/qi.hpp:16:
> > > In file included from /usr/include/boost/spirit/home/qi.hpp:14:
> > > In file included from /usr/include/boost/spirit/home/qi/action.hpp:14:
> > > In file included from
> > > /usr/include/boost/spirit/home/qi/action/action.hpp:14:
> > > In file included from
> > > /usr/include/boost/spirit/home/qi/meta_compiler.hpp:14:
> > > In file included from
> > > /usr/include/boost/spirit/home/support/meta_compiler.hpp:17:
> > > In file included from
> > > /usr/include/boost/spirit/home/support/make_component.hpp:15:
> > > In file included from
> > > /usr/include/boost/spirit/home/support/detail/make_cons.hpp:16:
> > > In file included from /usr/include/boost/fusion/include/cons.hpp:10:
> > > In file included from /usr/include/boost/fusion/support/config.hpp:13:
> > > In file included from
> > > ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/11.0.1/../../../../include/c++/11.0.1/utility:70:
> > > In file included from
> > > ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/11.0.1/../../../../include/c++/11.0.1/bits/stl_pair.h:59:
> > > In file included from
> > > ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/11.0.1/../../../../include/c++/11.0.1/bits/move.h:57:
> > > ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/11.0.1/../../../../include/c++/11.0.1/type_traits:1060:7:
> > > error: static_assert failed due to requirement
> > > 'std::__is_complete_or_unbounded(std::__type_identity<boost::spirit::info>{})'
> > > "template argument must be a complete class or an unbounded array"
> > >      static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
> > >      ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > > ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/11.0.1/../../../../include/c++/11.0.1/type_traits:139:26:
> > > note: in instantiation of template class
> > > 'std::is_copy_assignable<boost::spirit::info>' requested here
> > >    : public conditional<_B1::value, _B2, _B1>::type
> > >                         ^
> > > ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/11.0.1/../../../../include/c++/11.0.1/bits/stl_pair.h:391:3:
> > > note: in instantiation of template class
> > > 'std::__and_<std::is_copy_assignable<boost::spirit::info>,
> > > std::is_copy_assignable<boost::spirit::info>>' requested here
> > >                __and_<is_copy_assignable<_T1>,
> > >                ^
> > > ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/11.0.1/../../../../include/c++/11.0.1/bits/iterator_concepts.h:949:29:
> > > note: in instantiation of template class 'std::pair<boost::spirit::info,
> > > boost::spirit::info>' requested here
> > >          { __detail::__decay_copy(begin(__t)) } ->
> > > input_or_output_iterator;
> > >                                   ^
> > > ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/11.0.1/../../../../include/c++/11.0.1/bits/iterator_concepts.h:949:6:
> > > note: in instantiation of requirement here
> > >          { __detail::__decay_copy(begin(__t)) } ->
> > > input_or_output_iterator;
> > >            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > > ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/11.0.1/../../../../include/c++/11.0.1/bits/iterator_concepts.h:947:5:
> > > note: while substituting template arguments into constraint expression
> > > here
> > >        && requires(_Tp& __t)
> > >           ^~~~~~~~~~~~~~~~~~
> > > ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/11.0.1/../../../../include/c++/11.0.1/bits/ranges_base.h:115:7:
> > > note: (skipping 85 contexts in backtrace; use -ftemplate-backtrace-limit=0
> > > to see all)
> > >          || __adl_begin<_Tp>
> > >             ^
> > > /usr/include/boost/mpl/aux_/preprocessed/gcc/and.hpp:50:7: note: in
> > > instantiation of template class 'boost::mpl::aux::and_impl<true,
> > > boost::mpl::not_<boost::is_const<boost::variant<boost::spirit::info::nil_,
> > > std::basic_string<char>, boost::recursive_wrapper<boost::spirit::info>,
> > > boost::recursive_wrapper<std::pair<boost::spirit::info,
> > > boost::spirit::info>>,
> > > boost::recursive_wrapper<std::list<boost::spirit::info>>>>>,
> > > boost::detail::variant::is_variant_constructible_from<boost::variant<boost::spirit::info::nil_,
> > > std::basic_string<char>, boost::recursive_wrapper<boost::spirit::info>,
> > > boost::recursive_wrapper<std::pair<boost::spirit::info,
> > > boost::spirit::info>>,
> > > boost::recursive_wrapper<std::list<boost::spirit::info>>> &&,
> > > boost::mpl::l_item<mpl_::long_<5>, boost::spirit::info::nil_,
> > > boost::mpl::l_item<mpl_::long_<4>, std::basic_string<char>,
> > > boost::mpl::l_item<mpl_::long_<3>,
> > > boost::recursive_wrapper<boost::spirit::info>,
> > > boost::mpl::l_item<mpl_::long_<2>,
> > > boost::recursive_wrapper<std::pair<boost::spirit::info,
> > > boost::spirit::info>>, boost::mpl::l_item<mpl_::long_<1>,
> > > boost::recursive_wrapper<std::list<boost::spirit::info>>,
> > > boost::mpl::l_end>>>>>>, mpl_::bool_<true>, mpl_::bool_<true>>' requested
> > > here
> > >    : aux::and_impl<
> > >      ^
> > > /usr/include/boost/core/enable_if.hpp:41:41: note: in instantiation of
> > > template class
> > > 'boost::mpl::and_<boost::is_rvalue_reference<boost::variant<boost::spirit::info::nil_,
> > > std::basic_string<char>, boost::recursive_wrapper<boost::spirit::info>,
> > > boost::recursive_wrapper<std::pair<boost::spirit::info,
> > > boost::spirit::info>>,
> > > boost::recursive_wrapper<std::list<boost::spirit::info>>> &&>,
> > > boost::mpl::not_<boost::is_const<boost::variant<boost::spirit::info::nil_,
> > > std::basic_string<char>, boost::recursive_wrapper<boost::spirit::info>,
> > > boost::recursive_wrapper<std::pair<boost::spirit::info,
> > > boost::spirit::info>>,
> > > boost::recursive_wrapper<std::list<boost::spirit::info>>>>>,
> > > boost::detail::variant::is_variant_constructible_from<boost::variant<boost::spirit::info::nil_,
> > > std::basic_string<char>, boost::recursive_wrapper<boost::spirit::info>,
> > > boost::recursive_wrapper<std::pair<boost::spirit::info,
> > > boost::spirit::info>>,
> > > boost::recursive_wrapper<std::list<boost::spirit::info>>> &&,
> > > boost::mpl::l_item<mpl_::long_<5>, boost::spirit::info::nil_,
> > > boost::mpl::l_item<mpl_::long_<4>, std::basic_string<char>,
> > > boost::mpl::l_item<mpl_::long_<3>,
> > > boost::recursive_wrapper<boost::spirit::info>,
> > > boost::mpl::l_item<mpl_::long_<2>,
> > > boost::recursive_wrapper<std::pair<boost::spirit::info,
> > > boost::spirit::info>>, boost::mpl::l_item<mpl_::long_<1>,
> > > boost::recursive_wrapper<std::list<boost::spirit::info>>,
> > > boost::mpl::l_end>>>>>>>' requested here
> > >  struct enable_if : public enable_if_c<Cond::value, T> {};
> > >                                        ^
> > > /usr/include/boost/variant/variant.hpp:2136:21: note: in instantiation of
> > > template class
> > > 'boost::enable_if<boost::mpl::and_<boost::is_rvalue_reference<boost::variant<boost::spirit::info::nil_,
> > > std::basic_string<char>, boost::recursive_wrapper<boost::spirit::info>,
> > > boost::recursive_wrapper<std::pair<boost::spirit::info,
> > > boost::spirit::info>>,
> > > boost::recursive_wrapper<std::list<boost::spirit::info>>> &&>,
> > > boost::mpl::not_<boost::is_const<boost::variant<boost::spirit::info::nil_,
> > > std::basic_string<char>, boost::recursive_wrapper<boost::spirit::info>,
> > > boost::recursive_wrapper<std::pair<boost::spirit::info,
> > > boost::spirit::info>>,
> > > boost::recursive_wrapper<std::list<boost::spirit::info>>>>>,
> > > boost::detail::variant::is_variant_constructible_from<boost::variant<boost::spirit::info::nil_,
> > > std::basic_string<char>, boost::recursive_wrapper<boost::spirit::info>,
> > > boost::recursive_wrapper<std::pair<boost::spirit::info,
> > > boost::spirit::info>>,
> > > boost::recursive_wrapper<std::list<boost::spirit::info>>> &&,
> > > boost::mpl::l_item<mpl_::long_<5>, boost::spirit::info::nil_,
> > > boost::mpl::l_item<mpl_::long_<4>, std::basic_string<char>,
> > > boost::mpl::l_item<mpl_::long_<3>,
> > > boost::recursive_wrapper<boost::spirit::info>,
> > > boost::mpl::l_item<mpl_::long_<2>,
> > > boost::recursive_wrapper<std::pair<boost::spirit::info,
> > > boost::spirit::info>>, boost::mpl::l_item<mpl_::long_<1>,
> > > boost::recursive_wrapper<std::list<boost::spirit::info>>,
> > > boost::mpl::l_end>>>>>>>, boost::variant<boost::spirit::info::nil_,
> > > std::basic_string<char>, boost::recursive_wrapper<boost::spirit::info>,
> > > boost::recursive_wrapper<std::pair<boost::spirit::info,
> > > boost::spirit::info>>,
> > > boost::recursive_wrapper<std::list<boost::spirit::info>>> &>' requested
> > > here
> > >    typename boost::enable_if<
> > >                    ^
> > > /usr/include/boost/variant/variant.hpp:1105:7: note: while substituting
> > > deduced template arguments into function template 'operator=' [with T =
> > > boost::variant<boost::spirit::info::nil_, std::basic_string<char>,
> > > boost::recursive_wrapper<boost::spirit::info>,
> > > boost::recursive_wrapper<std::pair<boost::spirit::info,
> > > boost::spirit::info>>,
> > > boost::recursive_wrapper<std::list<boost::spirit::info>>>]
> > > class variant
> > >      ^
> > > /usr/include/boost/spirit/home/support/info.hpp:29:12: note: while
> > > declaring the implicit move assignment operator for 'info'
> > >    struct info
> > >           ^
> > > In file included from test.cc:1:
> > > In file included from /usr/include/boost/spirit/include/qi.hpp:16:
> > > In file included from /usr/include/boost/spirit/home/qi.hpp:14:
> > > In file included from /usr/include/boost/spirit/home/qi/action.hpp:14:
> > > In file included from
> > > /usr/include/boost/spirit/home/qi/action/action.hpp:14:
> > > In file included from
> > > /usr/include/boost/spirit/home/qi/meta_compiler.hpp:14:
> > > In file included from
> > > /usr/include/boost/spirit/home/support/meta_compiler.hpp:17:
> > > In file included from
> > > /usr/include/boost/spirit/home/support/make_component.hpp:15:
> > > In file included from
> > > /usr/include/boost/spirit/home/support/detail/make_cons.hpp:16:
> > > In file included from /usr/include/boost/fusion/include/cons.hpp:10:
> > > In file included from /usr/include/boost/fusion/support/config.hpp:13:
> > > In file included from
> > > ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/11.0.1/../../../../include/c++/11.0.1/utility:70:
> > > In file included from
> > > ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/11.0.1/../../../../include/c++/11.0.1/bits/stl_pair.h:59:
> > > In file included from
> > > ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/11.0.1/../../../../include/c++/11.0.1/bits/move.h:57:
> > > ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/11.0.1/../../../../include/c++/11.0.1/type_traits:1081:7:
> > > error: static_assert failed due to requirement
> > > 'std::__is_complete_or_unbounded(std::__type_identity<boost::spirit::info>{})'
> > > "template argument must be a complete class or an unbounded array"
> > >      static_assert(std::__is_complete_or_unbounded(__type_identity<_Tp>{}),
> > >      ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > > ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/11.0.1/../../../../include/c++/11.0.1/type_traits:139:26:
> > > note: in instantiation of template class
> > > 'std::is_move_assignable<boost::spirit::info>' requested here
> > >    : public conditional<_B1::value, _B2, _B1>::type
> > >                         ^
> > > ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/11.0.1/../../../../include/c++/11.0.1/bits/stl_pair.h:402:3:
> > > note: in instantiation of template class
> > > 'std::__and_<std::is_move_assignable<boost::spirit::info>,
> > > std::is_move_assignable<boost::spirit::info>>' requested here
> > >                __and_<is_move_assignable<_T1>,
> > >                ^
> > > ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/11.0.1/../../../../include/c++/11.0.1/bits/iterator_concepts.h:949:29:
> > > note: in instantiation of template class 'std::pair<boost::spirit::info,
> > > boost::spirit::info>' requested here
> > >          { __detail::__decay_copy(begin(__t)) } ->
> > > input_or_output_iterator;
> > >                                   ^
> > > ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/11.0.1/../../../../include/c++/11.0.1/bits/iterator_concepts.h:949:6:
> > > note: in instantiation of requirement here
> > >          { __detail::__decay_copy(begin(__t)) } ->
> > > input_or_output_iterator;
> > >            ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > > ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/11.0.1/../../../../include/c++/11.0.1/bits/iterator_concepts.h:947:5:
> > > note: while substituting template arguments into constraint expression
> > > here
> > >        && requires(_Tp& __t)
> > >           ^~~~~~~~~~~~~~~~~~
> > > ~/gcc/trunk/inst/lib/gcc/x86_64-pc-linux-gnu/11.0.1/../../../../include/c++/11.0.1/bits/ranges_base.h:115:7:
> > > note: (skipping 85 contexts in backtrace; use -ftemplate-backtrace-limit=0
> > > to see all)
> > >          || __adl_begin<_Tp>
> > >             ^
> > > /usr/include/boost/mpl/aux_/preprocessed/gcc/and.hpp:50:7: note: in
> > > instantiation of template class 'boost::mpl::aux::and_impl<true,
> > > boost::mpl::not_<boost::is_const<boost::variant<boost::spirit::info::nil_,
> > > std::basic_string<char>, boost::recursive_wrapper<boost::spirit::info>,
> > > boost::recursive_wrapper<std::pair<boost::spirit::info,
> > > boost::spirit::info>>,
> > > boost::recursive_wrapper<std::list<boost::spirit::info>>>>>,
> > > boost::detail::variant::is_variant_constructible_from<boost::variant<boost::spirit::info::nil_,
> > > std::basic_string<char>, boost::recursive_wrapper<boost::spirit::info>,
> > > boost::recursive_wrapper<std::pair<boost::spirit::info,
> > > boost::spirit::info>>,
> > > boost::recursive_wrapper<std::list<boost::spirit::info>>> &&,
> > > boost::mpl::l_item<mpl_::long_<5>, boost::spirit::info::nil_,
> > > boost::mpl::l_item<mpl_::long_<4>, std::basic_string<char>,
> > > boost::mpl::l_item<mpl_::long_<3>,
> > > boost::recursive_wrapper<boost::spirit::info>,
> > > boost::mpl::l_item<mpl_::long_<2>,
> > > boost::recursive_wrapper<std::pair<boost::spirit::info,
> > > boost::spirit::info>>, boost::mpl::l_item<mpl_::long_<1>,
> > > boost::recursive_wrapper<std::list<boost::spirit::info>>,
> > > boost::mpl::l_end>>>>>>, mpl_::bool_<true>, mpl_::bool_<true>>' requested
> > > here
> > >    : aux::and_impl<
> > >      ^
> > > /usr/include/boost/core/enable_if.hpp:41:41: note: in instantiation of
> > > template class
> > > 'boost::mpl::and_<boost::is_rvalue_reference<boost::variant<boost::spirit::info::nil_,
> > > std::basic_string<char>, boost::recursive_wrapper<boost::spirit::info>,
> > > boost::recursive_wrapper<std::pair<boost::spirit::info,
> > > boost::spirit::info>>,
> > > boost::recursive_wrapper<std::list<boost::spirit::info>>> &&>,
> > > boost::mpl::not_<boost::is_const<boost::variant<boost::spirit::info::nil_,
> > > std::basic_string<char>, boost::recursive_wrapper<boost::spirit::info>,
> > > boost::recursive_wrapper<std::pair<boost::spirit::info,
> > > boost::spirit::info>>,
> > > boost::recursive_wrapper<std::list<boost::spirit::info>>>>>,
> > > boost::detail::variant::is_variant_constructible_from<boost::variant<boost::spirit::info::nil_,
> > > std::basic_string<char>, boost::recursive_wrapper<boost::spirit::info>,
> > > boost::recursive_wrapper<std::pair<boost::spirit::info,
> > > boost::spirit::info>>,
> > > boost::recursive_wrapper<std::list<boost::spirit::info>>> &&,
> > > boost::mpl::l_item<mpl_::long_<5>, boost::spirit::info::nil_,
> > > boost::mpl::l_item<mpl_::long_<4>, std::basic_string<char>,
> > > boost::mpl::l_item<mpl_::long_<3>,
> > > boost::recursive_wrapper<boost::spirit::info>,
> > > boost::mpl::l_item<mpl_::long_<2>,
> > > boost::recursive_wrapper<std::pair<boost::spirit::info,
> > > boost::spirit::info>>, boost::mpl::l_item<mpl_::long_<1>,
> > > boost::recursive_wrapper<std::list<boost::spirit::info>>,
> > > boost::mpl::l_end>>>>>>>' requested here
> > >  struct enable_if : public enable_if_c<Cond::value, T> {};
> > >                                        ^
> > > /usr/include/boost/variant/variant.hpp:2136:21: note: in instantiation of
> > > template class
> > > 'boost::enable_if<boost::mpl::and_<boost::is_rvalue_reference<boost::variant<boost::spirit::info::nil_,
> > > std::basic_string<char>, boost::recursive_wrapper<boost::spirit::info>,
> > > boost::recursive_wrapper<std::pair<boost::spirit::info,
> > > boost::spirit::info>>,
> > > boost::recursive_wrapper<std::list<boost::spirit::info>>> &&>,
> > > boost::mpl::not_<boost::is_const<boost::variant<boost::spirit::info::nil_,
> > > std::basic_string<char>, boost::recursive_wrapper<boost::spirit::info>,
> > > boost::recursive_wrapper<std::pair<boost::spirit::info,
> > > boost::spirit::info>>,
> > > boost::recursive_wrapper<std::list<boost::spirit::info>>>>>,
> > > boost::detail::variant::is_variant_constructible_from<boost::variant<boost::spirit::info::nil_,
> > > std::basic_string<char>, boost::recursive_wrapper<boost::spirit::info>,
> > > boost::recursive_wrapper<std::pair<boost::spirit::info,
> > > boost::spirit::info>>,
> > > boost::recursive_wrapper<std::list<boost::spirit::info>>> &&,
> > > boost::mpl::l_item<mpl_::long_<5>, boost::spirit::info::nil_,
> > > boost::mpl::l_item<mpl_::long_<4>, std::basic_string<char>,
> > > boost::mpl::l_item<mpl_::long_<3>,
> > > boost::recursive_wrapper<boost::spirit::info>,
> > > boost::mpl::l_item<mpl_::long_<2>,
> > > boost::recursive_wrapper<std::pair<boost::spirit::info,
> > > boost::spirit::info>>, boost::mpl::l_item<mpl_::long_<1>,
> > > boost::recursive_wrapper<std::list<boost::spirit::info>>,
> > > boost::mpl::l_end>>>>>>>, boost::variant<boost::spirit::info::nil_,
> > > std::basic_string<char>, boost::recursive_wrapper<boost::spirit::info>,
> > > boost::recursive_wrapper<std::pair<boost::spirit::info,
> > > boost::spirit::info>>,
> > > boost::recursive_wrapper<std::list<boost::spirit::info>>> &>' requested
> > > here
> > >    typename boost::enable_if<
> > >                    ^
> > > /usr/include/boost/variant/variant.hpp:1105:7: note: while substituting
> > > deduced template arguments into function template 'operator=' [with T =
> > > boost::variant<boost::spirit::info::nil_, std::basic_string<char>,
> > > boost::recursive_wrapper<boost::spirit::info>,
> > > boost::recursive_wrapper<std::pair<boost::spirit::info,
> > > boost::spirit::info>>,
> > > boost::recursive_wrapper<std::list<boost::spirit::info>>>]
> > > class variant
> > >      ^
> > > /usr/include/boost/spirit/home/support/info.hpp:29:12: note: while
> > > declaring the implicit move assignment operator for 'info'
> > >    struct info
> > >           ^
> > > 4 errors generated.
> 
> 



More information about the Libstdc++ mailing list