[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 05:22:06 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:

This makes no sense - DR applies as far back as make sense.
If we decide lambdas are available in all languages modes, then all relevant DRs apply to and there is no reason not to test it (at least we should not go out of our way to not test it)

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


More information about the cfe-commits mailing list