Debian Codegraph @

gcc/testsuite/g++.dg/cpp23/lambda-specifiers1.C

raw
1 // P1102R2 - Down with ()!
2 // { dg-do compile { target c++11 } }
3 // { dg-options "" }
4
5 void
6 foo ()
7 {
8 auto a = [] mutable {}; // { dg-warning "parameter declaration before lambda declaration specifiers only optional with" "" { target c++20_down } }
9 #if __cpp_constexpr >= 201603L
10 auto b = [] constexpr {}; // { dg-warning "parameter declaration before lambda declaration specifiers only optional with" "" { target { c++17 && c++20_down } } }
11 #endif
12 #if __cpp_consteval >= 201811L
13 auto c = [] consteval {}; // { dg-warning "parameter declaration before lambda declaration specifiers only optional with" "" { target c++20_only } }
14 #endif
15 auto d = [] throw() {}; // { dg-warning "parameter declaration before lambda exception specification only optional with" "" { target c++20_down } }
16 auto e = [] noexcept {}; // { dg-warning "parameter declaration before lambda exception specification only optional with" "" { target c++20_down } }
17 auto f = [] -> int { return 0; }; // { dg-warning "parameter declaration before lambda trailing return type only optional with" "" { target c++20_down } }
18 }