]> gcc.gnu.org Git - gcc.git/commit
c++: elaborated-type-spec in requires-expr [PR101677]
authorJason Merrill <jason@redhat.com>
Mon, 28 Mar 2022 02:31:51 +0000 (22:31 -0400)
committerJason Merrill <jason@redhat.com>
Tue, 5 Apr 2022 16:28:59 +0000 (12:28 -0400)
commit1de6612d994ada8edaab18bbc6afd8e9a57413aa
tree89462116fe7189eb55b70b0692b66519217668f9
parent5c8d22b00adedc21f8b697dd6b990f4821a06634
c++: elaborated-type-spec in requires-expr [PR101677]

We were failing to declare class S in the global namespace because we were
treating the requires-expression parameter scope as a normal block scope, so
the implicit declaration went there.

It seems to me that the requires parameter scope is more like a function
parameter scope (not least in the use of the word "parameter"), so let's
change the scope kind.  But then we need to adjust the prohibition on
placeholders declaring implicit template parameters.

PR c++/101677

gcc/cp/ChangeLog:

* name-lookup.h (struct cp_binding_level): Add requires_expression
bit-field.
* parser.cc (cp_parser_requires_expression): Set it.
(synthesize_implicit_template_parm): Check it.

gcc/testsuite/ChangeLog:

* g++.dg/cpp2a/concepts-pr67178.C: Adjust error.
* g++.dg/cpp2a/concepts-requires28.C: New test.
gcc/cp/name-lookup.h
gcc/cp/parser.cc
gcc/testsuite/g++.dg/cpp2a/concepts-pr67178.C
gcc/testsuite/g++.dg/cpp2a/concepts-requires28.C [new file with mode: 0644]
This page took 0.059316 seconds and 5 git commands to generate.