[clang] [clang] Add tests for some of CWG issues resolved in Croydon (2026-03) (PR #189299)
Aaron Ballman via cfe-commits
cfe-commits at lists.llvm.org
Tue May 5 05:56:29 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
----------------
AaronBallman wrote:
Vlad and I talked about this a bit in a 1:1 today and I'm changing my recommendation: there's a lot of work to be done with improving our testing hierarchy as a whole, but in the ideal state, the DR tests (specifically) would only be testing the wording from the standard plus the DR resolution, and so things like backported feature behavior would still need testing, but outside of the DR test directory. There will be some awkward situations no matter what way we go; but this will still ensure we have appropriate test coverage. Other improvements (such as an ability to share boilerplate between tests, improving test coverage in newer standards modes, etc) are also necessary, but that goes beyond what's reasonable for this PR.
tl;dr: Vlad to move the C++98 testing bits to a separate file so they're still tested.
https://github.com/llvm/llvm-project/pull/189299
More information about the cfe-commits
mailing list