c++: change -fconcepts to mean C++20 concepts
[official-gcc.git] / gcc / testsuite / g++.dg / concepts / intro2.C
blob5c6906c8d352f3a7a952255806bc261a42067d1c
1 // { dg-do compile { target c++17_only } }
2 // { dg-options "-fconcepts-ts" }
4 #include <cassert>
6 template<typename T>
7   concept bool C() { return __is_class(T); }
9 template<int N>
10   concept bool P() { return true; }
12 C{A} struct S1
14   P{B} int f1();
17 struct S2 {};
19 int main()
21   S1<S2> s;
23   assert(s.f1<10>() == sizeof(S2) + 10);
24   return 0;
27 C{A} P{B} int S1<A>::f1() { return B + sizeof(A); }