1 // { dg-options "-std=c++17 -fconcepts" }
3 // Check shorthand notation.
6 concept bool Type() { return true; }
8 template<typename T, typename U>
9 concept bool Same() { return __is_same_as(T, U); }
11 template<Same<int> T> struct S1 { };
12 template<typename T, Same<T> U> struct S2 { };
14 void f(Same<int> q) { }
15 void g(Type a, Same<decltype(a)> b) { }
18 S1<char> s1; // { dg-error "constraint|invalid" }
19 S2<int, char> s2; // { dg-error "constraint|invalid" }
21 f('a'); // { dg-error "cannot" }
22 g(0, 'a'); // { dg-error "cannot" }