[C++ PATCH] Deprecate -ffriend-injection
[official-gcc.git] / gcc / testsuite / g++.dg / concepts / fn5.C
blobd4a2e003b9c089bf8e604adfdf95da0bbf782136
1 // { dg-options "-std=c++17 -fconcepts" }
3 // Check shorthand notation.
5 template<typename T>
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) { }
17 int main() {
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" }