From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 23798386181D; Tue, 30 Mar 2021 14:27:43 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 23798386181D From: "hewillk at gmail dot com" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/99831] New: ICE: in reshape_init, at cp/decl.c:6720 Date: Tue, 30 Mar 2021 14:27:42 +0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: gcc X-Bugzilla-Component: c++ X-Bugzilla-Version: 11.0 X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: hewillk at gmail dot com X-Bugzilla-Status: UNCONFIRMED 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: bug_id short_desc product version bug_status bug_severity priority component assigned_to reporter target_milestone Message-ID: 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: Tue, 30 Mar 2021 14:27:43 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D99831 Bug ID: 99831 Summary: ICE: in reshape_init, at cp/decl.c:6720 Product: gcc Version: 11.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: hewillk at gmail dot com Target Milestone: --- This is a complicated one since I don't know how to reduce it. https://godbolt.org/z/rqTGxMWef #include template struct StringLiteral { constexpr StringLiteral(const char (&str)[N]) { std::ranges::copy_n(str, N, value); } char value[N]; }; template struct string{ constexpr bool operator=3D=3D(const string&) const noexcept =3D default; }; template constexpr auto operator+(string, string) { constexpr auto L3 =3D []{ constexpr auto size1 =3D sizeof(L1.value); constexpr auto size2 =3D sizeof(L2.value); char value[size1 + size2 - 1] =3D {}; std::ranges::sort(value); std::ranges::copy_n(L1.value, size1, value); std::ranges::copy_n(L2.value, size2, value + size1 - 1); return StringLiteral{value}; }(); return string{}; } static_assert( string<"hello, world">{} =3D=3D string<"hello">{} + string<", world">{} ); static_assert( string<"a rose is a rose is a rose">{} =3D=3D string<"a rose">{} + string<" is ">{} +=20 string<"a rose">{} + string<" is ">{} +=20 string<"a rose">{} ); :36:40: internal compiler error: in reshape_init, at cp/decl.c:6720 36 | string<"a rose is a rose is a rose">{} =3D=3D | ^ 0x1cfb6a9 internal_error(char const*, ...) ???:0 0x6ba871 fancy_abort(char const*, int, char const*) ???:0 0x7810b6 reshape_init(tree_node*, tree_node*, int) ???:0 0x97e050 finish_compound_literal(tree_node*, tree_node*, int, fcl_t) ???:0 0x8e12ad c_parse_file() ???:0 0xa600a2 c_common_parse_file() ???:0 Please submit a full bug report, with preprocessed source if appropriate.=