[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / clang / test / CXX / class.derived / class.virtual / p6.cpp
blobf0243a776b6be0b61ec766c6e7add94ee1fc9570
1 // RUN: %clang_cc1 -std=c++2a -verify %s
3 template<typename T>
4 class A {
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}}
9 };
11 template<typename T>
12 class B : A<T> {
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(); };
20 template struct C<D>;
21 // expected-note@-1{{in instantiation of template class 'C<D>' requested here}}