| 1 |
// { dg-do compile { target c++17 } } |
| 2 |
// { dg-options "-fconcepts" } |
| 3 |
|
| 4 |
// template<typename T> |
| 5 |
// concept bool C() { return true; } |
| 6 |
|
| 7 |
|
| 8 |
template<typename T> |
| 9 |
concept C = true; |
| 10 |
|
| 11 |
void f1(C auto, C auto); |
| 12 |
void f2(C auto, C auto); |
| 13 |
void f3(C auto, C auto); |
| 14 |
|
| 15 |
void f1(C auto, C auto) { } |
| 16 |
|
| 17 |
template<C T1, C T2> |
| 18 |
void f2(T1, T2) { } |
| 19 |
|
| 20 |
template<typename T, typename U> |
| 21 |
requires C<T> && C<U> |
| 22 |
void f3(T, U) { } |
| 23 |
|
| 24 |
int main() { |
| 25 |
f1(0, 0); |
| 26 |
f2(0, 0); // { dg-error "ambiguous" } |
| 27 |
f3(0, 0); // { dg-error "ambiguous" } |
| 28 |
} |