1 // PR c++/67240 2 // { dg-do compile { target c++17 } } 3 // { dg-options "-fconcepts" } 4 foo(int x)5int foo(int x) 6 { 7 return x; 8 } 9 10 template <typename T> requires(T x)11concept bool C1 = requires (T x) { 12 {foo(x)} -> int&; 13 }; 14 15 template <typename T> requires(T x)16concept bool C2 = requires (T x) { 17 {foo(x)} -> void; 18 }; 19 20 static_assert( C1<int> ); // { dg-error "assert" } 21 static_assert( C2<int> ); // { dg-error "assert" } 22