[clang] [clang] Add tests for some of CWG issues resolved in Croydon (2026-03) (PR #189299)
Vlad Serebrennikov via cfe-commits
cfe-commits at lists.llvm.org
Sat May 9 01:00:35 PDT 2026
================
@@ -21,3 +21,14 @@ void f(
}
} // namespace cwg3005
+
+namespace cwg3035 { // cwg3035: no
+#if __cplusplus >= 201103L
+static union {
+ int x = [] { return 42; }();
+ // FIXME-error at -1 {{lambda expressions are not allowed in anonymous unions}}
+};
+#endif
+} // namespace cwg3035
----------------
Endilll wrote:
I added this test to `SemaCXX/lambda-expression.cpp`, which is run in C++03 mode.
https://github.com/llvm/llvm-project/pull/189299
More information about the cfe-commits
mailing list