gcc/testsuite/g++.dg/cpp2a/concepts-template-parm2.C
raw| 1 | // { dg-do compile { target c++20 } } |
| 2 | |
| 3 | template<typename T> |
| 4 | concept Int = __is_same_as(T, int); |
| 5 | |
| 6 | template<typename> struct Foo; |
| 7 | |
| 8 | // Instantiation of default arguments happens at the point of |
| 9 | // instantiation for the class. |
| 10 | |
| 11 | template<Int T = char> struct S1 { }; |
| 12 | template<Int auto X = false> struct S2 { }; |
| 13 | |
| 14 | S1<> s1; // { dg-error "constraint failure" } |
| 15 | S2<> s2; // { dg-error "placeholder constraints not satisfied" } |