1 // { dg-do compile { target c++17_only } }
2 // { dg-options "-fconcepts-ts" }
4 // Check shorthand notation.
7 concept bool Type() { return true; }
9 template<typename T, typename U>
10 concept bool Same() { return __is_same_as(T, U); }
12 template<Same<int> T> struct S1 { };
13 template<typename T, Same<T> U> struct S2 { };
15 void f(Same<int> q) { }
16 void g(Type a, Same<decltype(a)> b) { }
19 S1<char> s1; // { dg-error "constraint|invalid" }
20 S2<int, char> s2; // { dg-error "constraint|invalid" }
22 f('a'); // { dg-error "no match" }
23 g(0, 'a'); // { dg-error "no match" }