[C++ PATCH] Deprecate -ffriend-injection
[official-gcc.git] / gcc / testsuite / g++.dg / concepts / explicit-inst2.C
blobf47b7585e62d56d3242abb0f892e6fca5b9243e6
1 // { dg-options "-std=c++17 -fconcepts" }
3 template<typename T>
4   concept bool C() { return __is_class(T); }
6 template<typename T>
7   concept bool D() { return C<T>() && __is_empty(T); }
9 struct X { };
10 struct Y { int n; };
12 template<typename T> struct S  { void f1() { } };  // #1
13 template<C T> struct S<T> { void f2() { } };      // #2
14 template<D T> struct S<T> { void f3() { } };      // #3
16 template struct S<int>; // Instantiate #1
17 template struct S<X>; // Instantiate #2
18 template struct S<Y>; // Instantiate #2
20 int main() {
21   S<int> i; i.f1();
22   S<X> x; x.f3();
23   S<Y> y; y.f2();