https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97740

--- Comment #2 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
The trunk produces:
Output of x86-64 gcc (trunk) (Compiler #2)
<source>: In instantiation of
'cld::detail::CommandLine::Pack<detail::INCLUDESarg0, detail::INCLUDESarg1,
detail::INCLUDESarg2>::parseOptionsImpl()::<lambda(auto:6&& ...)> [with auto:6
= {const cld::detail::CommandLine::Arg&, const cld::detail::CommandLine::Arg&,
const cld::detail::CommandLine::Arg&}]':
/opt/compiler-explorer/gcc-trunk-20210828/include/c++/12.0.0/type_traits:2555:26:
  required by substitution of 'template<class _Fn, class ... _Args> static
std::__result_of_success<decltype (declval<_Fn>()((declval<_Args>)()...)),
std::__invoke_other> std::__result_of_other_impl::_S_test(int) [with _Fn =
cld::detail::CommandLine::Pack<detail::INCLUDESarg0, detail::INCLUDESarg1,
detail::INCLUDESarg2>::parseOptionsImpl()::<lambda(auto:6&& ...)>; _Args =
{const cld::detail::CommandLine::Arg&, const cld::detail::CommandLine::Arg&,
const cld::detail::CommandLine::Arg&}]'
/opt/compiler-explorer/gcc-trunk-20210828/include/c++/12.0.0/type_traits:2566:55:
  required from 'struct std::__result_of_impl<false, false,
cld::detail::CommandLine::Pack<detail::INCLUDESarg0, detail::INCLUDESarg1,
detail::INCLUDESarg2>::parseOptionsImpl()::<lambda(auto:6&& ...)>, const
cld::detail::CommandLine::Arg&, const cld::detail::CommandLine::Arg&, const
cld::detail::CommandLine::Arg&>'
/opt/compiler-explorer/gcc-trunk-20210828/include/c++/12.0.0/type_traits:151:12:
  recursively required by substitution of 'template<class _Result, class _Ret>
struct std::__is_invocable_impl<_Result, _Ret, true, std::__void_t<typename
_CTp::type> > [with _Result =
std::__invoke_result<cld::detail::CommandLine::Pack<detail::INCLUDESarg0,
detail::INCLUDESarg1,
detail::INCLUDESarg2>::parseOptionsImpl()::<lambda(auto:6&& ...)>, const
cld::detail::CommandLine::Arg&, const cld::detail::CommandLine::Arg&, const
cld::detail::CommandLine::Arg&>; _Ret = void]'
/opt/compiler-explorer/gcc-trunk-20210828/include/c++/12.0.0/type_traits:151:12:
  required from 'struct
std::__and_<std::__is_invocable_impl<std::__invoke_result<cld::detail::CommandLine::Pack<detail::INCLUDESarg0,
detail::INCLUDESarg1,
detail::INCLUDESarg2>::parseOptionsImpl()::<lambda(auto:6&& ...)>, const
cld::detail::CommandLine::Arg&, const cld::detail::CommandLine::Arg&, const
cld::detail::CommandLine::Arg&>, void, true, void>,
std::__call_is_nothrow<std::__invoke_result<cld::detail::CommandLine::Pack<detail::INCLUDESarg0,
detail::INCLUDESarg1,
detail::INCLUDESarg2>::parseOptionsImpl()::<lambda(auto:6&& ...)>, const
cld::detail::CommandLine::Arg&, const cld::detail::CommandLine::Arg&, const
cld::detail::CommandLine::Arg&>,
cld::detail::CommandLine::Pack<detail::INCLUDESarg0, detail::INCLUDESarg1,
detail::INCLUDESarg2>::parseOptionsImpl()::<lambda(auto:6&& ...)>, const
cld::detail::CommandLine::Arg&, const cld::detail::CommandLine::Arg&, const
cld::detail::CommandLine::Arg&> >'
/opt/compiler-explorer/gcc-trunk-20210828/include/c++/12.0.0/type_traits:3054:12:
  required from 'struct
std::is_nothrow_invocable<cld::detail::CommandLine::Pack<detail::INCLUDESarg0,
detail::INCLUDESarg1,
detail::INCLUDESarg2>::parseOptionsImpl()::<lambda(auto:6&& ...)>, const
cld::detail::CommandLine::Arg&, const cld::detail::CommandLine::Arg&, const
cld::detail::CommandLine::Arg&>'
/opt/compiler-explorer/gcc-trunk-20210828/include/c++/12.0.0/tuple:1872:37:  
required from 'constexpr const bool std::__unpack_std_tuple<template<class _Fn,
class ... _ArgTypes> struct std::is_nothrow_invocable,
cld::detail::CommandLine::Pack<detail::INCLUDESarg0, detail::INCLUDESarg1,
detail::INCLUDESarg2>::parseOptionsImpl()::<lambda(auto:6&& ...)>, const
std::tuple<cld::detail::CommandLine::Arg, cld::detail::CommandLine::Arg,
cld::detail::CommandLine::Arg>&>'
/opt/compiler-explorer/gcc-trunk-20210828/include/c++/12.0.0/tuple:1887:14:  
required from 'constexpr decltype(auto) std::apply(_Fn&&, _Tuple&&) [with _Fn =
cld::detail::CommandLine::Pack<detail::INCLUDESarg0, detail::INCLUDESarg1,
detail::INCLUDESarg2>::parseOptionsImpl()::<lambda(auto:6&& ...)>; _Tuple =
const std::tuple<cld::detail::CommandLine::Arg, cld::detail::CommandLine::Arg,
cld::detail::CommandLine::Arg>&]'
<source>:408:49:   required from 'static constexpr auto
cld::detail::CommandLine::Pack<args>::parseOptionsImpl() [with const auto&
...args = {detail::INCLUDESarg0, detail::INCLUDESarg1, detail::INCLUDESarg2}]'
<source>:444:49:   required from 'constexpr const auto
cld::detail::CommandLine::parsedTuple<cld::detail::CommandLine::Pack<detail::INCLUDESarg0,
detail::INCLUDESarg1, detail::INCLUDESarg2> >'
<source>:458:48:   required from 'constexpr auto
cld::detail::CommandLine::parseOptions(std::string_view, cld::CLIMultiArg)
[with T = cld::detail::CommandLine::Pack<detail::INCLUDESarg0,
detail::INCLUDESarg1, detail::INCLUDESarg2>; auto& ...args =
{detail::INCLUDESbind0, std::in_place_type<std::basic_string_view<char,
std::char_traits<char> > >}; std::string_view = std::basic_string_view<char>]'
<source>:502:5:   required from here
<source>:411:31: error: too many initializers for
'std::array<std::basic_string_view<char>, 3>'
  411 |                 input.value...};
      |                               ^


clang accepts the code using GCC's libstdc++ while rejects it using LLVM's
libc++:
<source>:410:20: error: implicit instantiation of undefined template
'std::array<std::string_view, 3>'
            return std::array<std::string_view, sizeof...(input)>{
                   ^

Reply via email to