1 // Generic lambda type dependence test part from N3690 5.1.2.12
2 // { dg-do compile { target c++14 } }
3 // { dg-options "-pedantic" }
5 void f(int, const int (&)[2] = {}) { } // #1
6 void f(const int&, const int (&)[1]) { } // #2
12 f(x); // OK: calls #1, does not capture x
14 auto g2 = [=](auto a) {
15 int selector[sizeof(a) == 1 ? 1 : 2]{};
16 f(x, selector); // OK: is a dependent expression, so captures x
22 auto test () { return 7.f; }
30 auto f = [] <typename T> (T const& s) mutable { // { dg-warning "lambda templates are only available with" "" { target c++17_down } }
34 auto g = [] (auto const& s) {
35 typename std::decay<decltype (s)>::type::N x;