[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / Parser / friend-concept.cpp
blobd771ca4d4178edc2bc368336e9dcc6976a566901
1 // RUN: %clang_cc1 -fsyntax-only -verify -std=c++20 %s
3 template<class>
4 concept fooable = true;
6 struct S {
7 template<class> friend concept x = requires { requires true; }; // expected-error {{friend declaration cannot be a concept}}
8 template<class> friend concept fooable; // expected-error {{friend declaration cannot be a concept}}
9 template<class> concept friend fooable; // expected-error {{expected unqualified-id}}
10 friend concept fooable; // expected-error {{friend declaration cannot be a concept}}
11 concept friend fooable; // expected-error {{friend declaration cannot be a concept}}
12 concept fooable; // expected-error {{concept declarations may only appear in global or namespace scope}}