From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id 316AB396EC73; Thu, 25 Feb 2021 21:45:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 316AB396EC73 From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/94521] Infinite loop with decltype of function parameter of type decltype([]{}) Date: Thu, 25 Feb 2021 21:45:13 +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.0 X-Bugzilla-Keywords: compile-time-hog X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org X-Bugzilla-Status: RESOLVED X-Bugzilla-Resolution: FIXED X-Bugzilla-Priority: P3 X-Bugzilla-Assigned-To: ppalka at gcc dot gnu.org X-Bugzilla-Target-Milestone: 10.0 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: Thu, 25 Feb 2021 21:45:13 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D94521 --- Comment #4 from CVS Commits --- The master branch has been updated by Patrick Palka : https://gcc.gnu.org/g:7fb9a1e929db520fd741e60d84ec1a58581a8299 commit r11-7406-g7fb9a1e929db520fd741e60d84ec1a58581a8299 Author: Patrick Palka Date: Thu Feb 25 16:44:34 2021 -0500 c++: Fix pretty printing the context of local class [PR99213] My r10-7705 patch for PR94521 made us set TFF_NO_FUNCTION_ARGUMENTS when pretty printing the function scope of a local class type in order to eliminate infinite recursion with a function signature that contains decltype([]{}). But due to the way dump_function_decl works, this change regressed our pretty printing of local class types whose context contains a class template specialization, as in the testcase below, in which we wrongly pretty print the two local types as 'A::f::S1' and 'B::f::S2'. This patch makes dump_scope pass TFF_NO_TEMPLATE_BINDINGS instead of TFF_NO_FUNCTION_ARGUMENTS when pretty printing a function scope. It appears this is the strictly better flag to use: it avoids the infinite recursion issue, it restores pretty printing of the function parameter list, and it stops dump_function_decl from trying to print a function template specialization in its own weird way. Summary of pretty printing differences for the below testcase: r10-7704: A::f() [with U =3D char; T =3D int]::S1 B::f() [with T =3D int]::S2 r10-7705: A::f::S1 B::f::S2 this patch: A::f()::S1 B::f()::S2 gcc/cp/ChangeLog: PR c++/99213 PR c++/94521 * error.c (dump_scope): Pass TFF_NO_TEMPLATE_BINDINGS instead of TFF_NO_FUNCTION_ARGUMENTS when dumping a function scope. gcc/testsuite/ChangeLog: PR c++/99213 PR c++/94521 * g++.dg/diagnostic/local1.C: New test.=