[clang] [clang] Add tests for some of CWG issues resolved in Croydon (2026-03) (PR #189299)

Corentin Jabot via cfe-commits cfe-commits at lists.llvm.org
Mon May 4 02:25:27 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
----------------
cor3ntin wrote:

now that we support lambda in c++03 (!) we don't need the `#if`

https://github.com/llvm/llvm-project/pull/189299


More information about the cfe-commits mailing list