1 // RUN: %clang_cc1 -std=c++2a -verify %s
5 virtual void f1() requires (sizeof(T
) == 0);
6 // expected-error@-1{{virtual function cannot have a requires clause}}
7 virtual void f2() requires (sizeof(T
) == 1);
8 // expected-error@-1{{virtual function cannot have a requires clause}}
13 virtual void f1() requires (sizeof(T
) == 0) override
{}
14 // expected-error@-1{{virtual function cannot have a requires clause}}
17 template<typename T
> struct C
: T
{void f() requires
true; };
18 // expected-error@-1{{virtual function cannot have a requires clause}}
19 struct D
{ virtual void f(); };
21 // expected-note@-1{{in instantiation of template class 'C<D>' requested here}}