PR c++/86728 - C variadic generic lambda.
[official-gcc.git] / gcc / testsuite / g++.dg / concepts / placeholder2.C
blobc8981b617de52ef842666291fef55606a9e0be36
1 // { dg-options "-std=c++17 -fconcepts" }
3 // Check argument deduction constraints.
4 // TODO: We shoul have more of these...
6 template<typename T>
7 concept bool C1 = sizeof(T) == 0;
9 template<typename T, typename U>
10 concept bool C2 = __is_same_as(T, U);
13 template<typename T>
14 concept bool D1()
16   return requires (T t) { { t } -> C1; };
19 template<typename T>
20 concept bool D2()
22   return requires (T t) { { t } -> C2<void>; };
25 void f1(D1) { }
26 void f2(D2) { }
28 int main()
30   f1(0); // { dg-error "cannot call" }
31   f2(0); // { dg-error "cannot call" }