From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 9C9583858417; Sat, 28 Aug 2021 22:16:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 9C9583858417 From: "pinskia at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/97740] Weird error message about accessing a private member of my own class inside of std::string_view inside of constexpr Date: Sat, 28 Aug 2021 22:16:01 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: pinskia at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: gcc-bugs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-bugs mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 28 Aug 2021 22:16:01 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D97740 --- Comment #2 from Andrew Pinski --- The trunk produces: Output of x86-64 gcc (trunk) (Compiler #2) : In instantiation of 'cld::detail::CommandLine::Pack::parseOptionsImpl():: [with aut= o:6 =3D {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:25= 55:26: required by substitution of 'template static std::__result_of_success()((declval<_Args>)()...)), std::__invoke_other> std::__result_of_other_impl::_S_test(int) [with _Fn =3D cld::detail::CommandLine::Pack::parseOptionsImpl()::; _Args =3D {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:25= 66:55: required from 'struct std::__result_of_impl::parseOptionsImpl()::, 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:15= 1:12: recursively required by substitution of 'template struct std::__is_invocable_impl<_Result, _Ret, true, std::__void_t > [with _Result =3D std::__invoke_result::parseOptionsImpl()::, const cld::detail::CommandLine::Arg&, const cld::detail::CommandLine::Arg&, const cld::detail::CommandLine::Arg&>; _Ret =3D void]' /opt/compiler-explorer/gcc-trunk-20210828/include/c++/12.0.0/type_traits:15= 1:12: required from 'struct std::__and_::parseOptionsImpl()::, const cld::detail::CommandLine::Arg&, const cld::detail::CommandLine::Arg&, const cld::detail::CommandLine::Arg&>, void, true, void>, std::__call_is_nothrow::parseOptionsImpl()::, const cld::detail::CommandLine::Arg&, const cld::detail::CommandLine::Arg&, const cld::detail::CommandLine::Arg&>, cld::detail::CommandLine::Pack::parseOptionsImpl()::, 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:30= 54:12: required from 'struct std::is_nothrow_invocable::parseOptionsImpl()::, 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:= =20=20 required from 'constexpr const bool std::__unpack_std_tuple struct std::is_nothrow_invocable, cld::detail::CommandLine::Pack::parseOptionsImpl()::, const std::tuple&>' /opt/compiler-explorer/gcc-trunk-20210828/include/c++/12.0.0/tuple:1887:14:= =20=20 required from 'constexpr decltype(auto) std::apply(_Fn&&, _Tuple&&) [with _= Fn =3D cld::detail::CommandLine::Pack::parseOptionsImpl()::; _Tuple = =3D const std::tuple&]' :408:49: required from 'static constexpr auto cld::detail::CommandLine::Pack::parseOptionsImpl() [with const auto& ...args =3D {detail::INCLUDESarg0, detail::INCLUDESarg1, detail::INCLUDESar= g2}]' :444:49: required from 'constexpr const auto cld::detail::CommandLine::parsedTuple >' :458:48: required from 'constexpr auto cld::detail::CommandLine::parseOptions(std::string_view, cld::CLIMultiArg) [with T =3D cld::detail::CommandLine::Pack; auto& ...args =3D {detail::INCLUDESbind0, std::in_place_type > >}; std::string_view =3D std::basic_string_view]' :502:5: required from here :411:31: error: too many initializers for 'std::array, 3>' 411 | input.value...}; | ^ clang accepts the code using GCC's libstdc++ while rejects it using LLVM's libc++: :410:20: error: implicit instantiation of undefined template 'std::array' return std::array{ ^=