
Diagnose this early after parsing declaration specifiers; this allows us to issue a better diagnostic. This also checks for `concept friend` and concept declarations w/o a template-head because it’s easiest to do that at the same time. Fixes #45182.
14 lines
710 B
C++
14 lines
710 B
C++
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++20 %s
|
|
|
|
template<class>
|
|
concept fooable = true;
|
|
|
|
struct S {
|
|
template<class> friend concept x = requires { requires true; }; // expected-error {{friend declaration cannot be a concept}}
|
|
template<class> friend concept fooable; // expected-error {{friend declaration cannot be a concept}}
|
|
template<class> concept friend fooable; // expected-error {{expected unqualified-id}}
|
|
friend concept fooable; // expected-error {{friend declaration cannot be a concept}}
|
|
concept friend fooable; // expected-error {{friend declaration cannot be a concept}}
|
|
concept fooable; // expected-error {{concept declarations may only appear in global or namespace scope}}
|
|
};
|