From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 48) id A7BC73858405; Tue, 9 Nov 2021 14:11:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org A7BC73858405 From: "cvs-commit at gcc dot gnu.org" To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/98394] Concept with auto... template parameter pack in if-statement causes compilation error Date: Tue, 09 Nov 2021 14:11: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.1.0 X-Bugzilla-Keywords: rejects-valid X-Bugzilla-Severity: normal X-Bugzilla-Who: cvs-commit at gcc dot gnu.org 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: 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, 09 Nov 2021 14:11:13 -0000 https://gcc.gnu.org/bugzilla/show_bug.cgi?id=3D98394 --- Comment #1 from CVS Commits --- The master branch has been updated by Patrick Palka : https://gcc.gnu.org/g:a22d910305a5232694ff48ead37a7f53e46b7202 commit r12-5053-ga22d910305a5232694ff48ead37a7f53e46b7202 Author: Patrick Palka Date: Tue Nov 9 09:09:43 2021 -0500 c++: bogus error w/ tentative type parse of concept-id [PR98394] Here when tentatively parsing the if condition as a declaration, we try to treat C<1> as the start of a constrained placeholder type, which we quickly reject because C doesn't accept a type as its first argument. But since we're parsing tentatively, we shouldn't emit an error in this case. In passing, also fix PR85846 by only overriding 'tentative' to false wh= en given a concept-name, and not also when given a concept-id that has an empty argument list. PR c++/98394 PR c++/85846 gcc/cp/ChangeLog: * parser.c (cp_parser_placeholder_type_specifier): Declare static. Don't override tentative to false when tmpl is a concept-id with empty argument list. Don't emit a "does not constrain a type" error when tentative. gcc/testsuite/ChangeLog: * g++.dg/cpp2a/concepts-pr98394.C: New test. * g++.dg/cpp2a/concepts-pr85846.C: New test.=