gcc/testsuite/g++.dg/cpp2a/concepts-return-req1.C
raw| 1 | // PR c++/92268 |
| 2 | // { dg-do compile { target c++20 } } |
| 3 | |
| 4 | template <class T> concept Two = true; |
| 5 | template <class T> concept One = Two<typename T::type>; |
| 6 | template <class T> concept Zero = requires |
| 7 | { |
| 8 | { T() } -> One; |
| 9 | }; |
| 10 | |
| 11 | template <class T> |
| 12 | void f() requires Zero<T>; |
| 13 | template <class T> |
| 14 | int f(...); |
| 15 | |
| 16 | int main() |
| 17 | { |
| 18 | f<int>(); // { dg-error "ambiguous" } |
| 19 | } |