From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 6161B3858C83; Tue, 26 Apr 2022 15:58:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 6161B3858C83 From: "mpolacek at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/100252] [9/10/11/12 Regression] Internal compiler error during template instantiation Date: Tue, 26 Apr 2022 15:58:06 +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: 10.3.1 X-Bugzilla-Keywords: ice-on-valid-code X-Bugzilla-Severity: normal X-Bugzilla-Who: mpolacek at gcc dot gnu.org X-Bugzilla-Status: NEW X-Bugzilla-Resolution: X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org X-Bugzilla-Target-Milestone: 9.5 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: Tue, 26 Apr 2022 15:58:06 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D100252 --- Comment #10 from Marek Polacek --- Proof of concept: --- a/gcc/cp/semantics.cc +++ b/gcc/cp/semantics.cc @@ -3296,6 +3296,14 @@ finish_compound_literal (tree type, tree compound_literal, if (TREE_CODE (compound_literal) =3D=3D CONSTRUCTOR) TREE_HAS_CONSTRUCTOR (compound_literal) =3D false; compound_literal =3D get_target_expr_sfinae (compound_literal, compl= ain); + if (parsing_nsdmi ()) + { + tree obj =3D TARGET_EXPR_SLOT (compound_literal); + tree &ctor =3D TARGET_EXPR_INITIAL (compound_literal); + replace_placeholders (compound_literal, obj); + if (TREE_CODE (ctor) =3D=3D CONSTRUCTOR) + CONSTRUCTOR_PLACEHOLDER_BOUNDARY (ctor) =3D false; + } } else /* For e.g. int{42} just make sure it's a prvalue. */=