1 // { dg-options "-std=c++17 -fconcepts" } 2 3 // Check argument deduction constraints. 4 // TODO: We shoul have more of these... 5 6 template<typename T> 7 concept bool C1 = sizeof(T) == 0; 8 9 template<typename T, typename U> 10 concept bool C2 = __is_same_as(T, U); 11 12 13 template<typename T> D1()14concept bool D1() 15 { 16 return requires (T t) { { t } -> C1; }; 17 } 18 19 template<typename T> D2()20concept bool D2() 21 { 22 return requires (T t) { { t } -> C2<void>; }; 23 } 24 f1(D1)25void f1(D1) { } f2(D2)26void f2(D2) { } 27 main()28int main() 29 { 30 f1(0); // { dg-error "cannot call" } 31 f2(0); // { dg-error "cannot call" } 32 } 33