Saar Raz 67c608a969 [Concepts] Deprecate -fconcepts-ts, enable Concepts under -std=c++2a
Now with concepts support merged and mostly complete, we do not need -fconcepts-ts
(which was also misleading as we were not implementing the TS) and can enable
concepts features under C++2a. A warning will be generated if users still attempt
to use -fconcepts-ts.
2020-01-24 00:48:59 +02:00

21 lines
757 B
C++

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