[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
Mon May 4 05:55:16 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:

DRs are written based on the Standard, not just on what our implementation does. C++98 doesn't have lambda wording, so this DR cannot apply to it. Feel free to test backported behavior in Sema tests, if it hasn't been already. In any case DR tests cannot be relied upon for coverage of our implementation.

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


More information about the cfe-commits mailing list