gcc/testsuite/g++.dg/cpp2a/concepts-pr87441.C
raw| 1 | // { dg-do compile { target c++20 } } |
| 2 | // { dg-additional-options "-fconcepts" } |
| 3 | |
| 4 | template<typename X, typename Y = X> |
| 5 | concept HasBinaryAdd = requires(X x, Y y) |
| 6 | { |
| 7 | {x + y} -> decltype(x + y); // { dg-error "return-type-requirement is not a type-constraint" } |
| 8 | }; |
| 9 | |
| 10 | void proc(HasBinaryAdd auto x, HasBinaryAdd auto y); |