aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp23/lambda-specifiers1.C
blob: 6729a4555ddd6c5a98771a71ee3b5bc9850c2bd7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// P1102R2 - Down with ()!
// { dg-do compile { target c++11 } }
// { dg-options "" }

void
foo ()
{
  auto a = [] mutable {};	// { dg-warning "parameter declaration before lambda declaration specifiers only optional with" "" { target c++20_down } }
#if __cpp_constexpr >= 201603L
  auto b = [] constexpr {};	// { dg-warning "parameter declaration before lambda declaration specifiers only optional with" "" { target { c++17 && c++20_down } } }
#endif
#if __cpp_consteval >= 201811L
  auto c = [] consteval {};	// { dg-warning "parameter declaration before lambda declaration specifiers only optional with" "" { target c++20_only } }
#endif
  auto d = [] throw() {};	// { dg-warning "parameter declaration before lambda exception specification only optional with" "" { target c++20_down } }
  auto e = [] noexcept {};	// { dg-warning "parameter declaration before lambda exception specification only optional with" "" { target c++20_down } }
  auto f = [] -> int { return 0; };	// { dg-warning "parameter declaration before lambda trailing return type only optional with" "" { target c++20_down } }
}