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