| 1 |
// { dg-do compile { target c++20 } } |
| 2 |
|
| 3 |
static decltype([] { }) f(); |
| 4 |
static decltype([] { }) f(); // { dg-error "ambiguating" } |
| 5 |
|
| 6 |
static decltype([] { }) g(); |
| 7 |
static decltype(g()) g(); // okay |
| 8 |
|
| 9 |
static void h(decltype([] { }) *) { } |
| 10 |
static void h(decltype([] { }) *) { } |
| 11 |
void x1() { h(nullptr); } // { dg-error "ambiguous" } |
| 12 |
|
| 13 |
using A = decltype([] { }); |
| 14 |
static void i(A *); |
| 15 |
static void i(A *) { } |
| 16 |
void x2() { i(nullptr); } // okay |
| 17 |
|
| 18 |
template <typename T> |
| 19 |
using B = decltype([] { }); |
| 20 |
static void j(B<char16_t> *) { } |
| 21 |
static void j(B<char32_t> *) { } |
| 22 |
void x3() { j(nullptr); } // { dg-error "ambiguous" } |
| 23 |
|
| 24 |
template <int N> static void k(decltype([]{ return 0; }())); |
| 25 |
template <int N> static void k(decltype([]{ return 0; }())); // okay |
| 26 |
template <int N> static void k(int); // okay |