// RUN: %clang_cc1 -std=c++2a -verify %s
constexpr bool is_same_v = false;
constexpr bool is_same_v<T, T> = true;
using T = void ;
void requires true; // expected-error{{non-templated function cannot have a requires clause}}
auto bool requires true; // expected-error{{non-templated function cannot have a requires clause}}
auto bool requires true; // expected-error{{non-templated function cannot have a requires clause}}
// expected-error@+1{{non-templated function cannot have a requires clause}}
auto requires true -> bool; // expected-error{{trailing return type must appear before trailing requires clause}}
void requires true; // expected-error{{non-templated function cannot have a requires clause}}
// expected-error@+1{{non-templated function cannot have a requires clause}}
void ; // expected-error{{trailing requires clause should be placed outside parentheses}}
// expected-error@+1{{non-templated function cannot have a requires clause}}
T xnon_templ requires true;
// expected-error@+2 2{{non-templated function cannot have a requires clause}}
;
void requires true; // OK
auto bool
requires true; // OK
auto bool requires true; // OK
auto requires true -> bool; // expected-error{{trailing return type must appear before trailing requires clause}}
int requires; // expected-error{{expected expression}}
int requires // expected-error{{expected expression}}
void requires true;
void ; // expected-error{{trailing requires clause should be placed outside parentheses}}
void ; // expected-error{{trailing requires clause should be placed outside parentheses}}
static_assert;
void requires true; // expected-error{{trailing requires clause can only be used when declaring a function}}
void ; // expected-error{{trailing requires clause can only be used when declaring a function}}
void ; // expected-error{{trailing requires clause can only be used when declaring a function}}
void ; // expected-error{{trailing requires clause should be placed outside parentheses}}
;
Foo<int> f;
;
;
-> requires true; // expected-error{{deduction guide cannot have a requires clause}}