aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp2a/lambda-uneval6.C
blob: 7d5aa316e93063dbd28ea6f84af245e894853d0d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// { dg-do compile { target c++20 } }

static decltype([] { }) f();
static decltype([] { }) f(); // { dg-error "ambiguating" }

static decltype([] { }) g();
static decltype(g()) g(); // okay

static void h(decltype([] { }) *) { }
static void h(decltype([] { }) *) { }
void x1() { h(nullptr); } // { dg-error "ambiguous" }

using A = decltype([] { });
static void i(A *);
static void i(A *) { }
void x2() { i(nullptr); } // okay

template <typename T>
using B = decltype([] { });
static void j(B<char16_t> *) { }
static void j(B<char32_t> *) { }
void x3() { j(nullptr); } // { dg-error "ambiguous" }

template <int N> static void k(decltype([]{ return 0; }()));
template <int N> static void k(decltype([]{ return 0; }())); // okay
template <int N> static void k(int); // okay