PR c++/86728 - C variadic generic lambda.
[official-gcc.git] / gcc / testsuite / g++.dg / concepts / class6.C
blob29dcb8ff97e6f07ec39dfc8407b4e82185e42693
1 // { dg-options "-std=c++17 -fconcepts" }
3 template<typename T>
4   concept bool One() { return sizeof(T) >= 4; }
6 template<typename T>
7   concept bool Two() { return One<T>() && sizeof(T) >= 8; }
9 // Check that there is no ecsacpe hatch
10 template<Two T> struct S4 { };
11 template<One T> struct S4<T> { }; // { dg-error "does not specialize" }
13 struct one_type { char x[4]; };
15 // Constraints are checked even when decls are not instantiatied.
16 S4<one_type>* x4b; // { dg-error "constraint|invalid" }
18 int main() { }