1 // { dg-do compile { target c++2a } } 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([] { }) *) { } x1()11void x1() { h(nullptr); } // { dg-error "ambiguous" } 12 13 using A = decltype([] { }); 14 static void i(A *); i(A *)15static void i(A *) { } x2()16void x2() { i(nullptr); } // okay 17 18 template <typename T> 19 using B = decltype([] { }); j(B<char16_t> *)20static void j(B<char16_t> *) { } j(B<char32_t> *)21static void j(B<char32_t> *) { } x3()22void 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 27