| 1 |
// RUN: %clang_cc1 -std=c++20 %s -verify=cxx20 |
| 2 |
// RUN: %clang_cc1 -std=c++23 %s -verify=cxx23 |
| 3 |
// RUN: %clang_cc1 -std=c++23 -Wpre-c++23-compat %s -verify=precxx23 |
| 4 |
// RUN: %clang_cc1 -std=c++23 -pedantic %s -verify=cxx23 |
| 5 |
|
| 6 |
//cxx23-no-diagnostics |
| 7 |
|
| 8 |
auto L1 = [] constexpr {}; |
| 9 |
// cxx20-warning@-1 {{lambda without a parameter clause is a C++23 extension}} |
| 10 |
auto L2 = []() static {}; |
| 11 |
// cxx20-warning@-1 {{static lambdas are a C++23 extension}} |
| 12 |
// precxx23-warning@-2 {{static lambdas are incompatible with C++ standards before C++23}} |
| 13 |
auto L3 = [] static {}; |
| 14 |
// cxx20-warning@-1 {{lambda without a parameter clause is a C++23 extension}} |
| 15 |
// cxx20-warning@-2 {{static lambdas are a C++23 extension}} |
| 16 |
// precxx23-warning@-3 {{static lambdas are incompatible with C++ standards before C++23}} |