[clang] [P3074] Partial implementation of support for trivial unions (PR #146815)

Vlad Serebrennikov via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 3 00:27:43 PDT 2025


================
@@ -23,8 +24,8 @@ int n;
 
 // - X is a union-like class that has a variant member with a non-trivial
 // default constructor,
-union Deleted1a { UserProvidedDefCtor u; }; // expected-note {{default constructor of 'Deleted1a' is implicitly deleted because variant field 'u' has a non-trivial default constructor}}
-Deleted1a d1a; // expected-error {{implicitly-deleted default constructor}}
+union Deleted1a { UserProvidedDefCtor u; }; // until26-note {{default constructor of 'Deleted1a' is implicitly deleted because variant field 'u' has a non-trivial default constructor}}
+Deleted1a d1a; // until26-error {{implicitly-deleted default constructor}}
----------------
Endilll wrote:

You should use `cxx98-23` or `cxx11-23`, like DR tests do. This implies that you need a new RUN line with C++23 mode, and, probably C++98 mode, too.

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


More information about the cfe-commits mailing list