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

Barry Revzin via cfe-commits cfe-commits at lists.llvm.org
Thu Jul 3 08:30:00 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}}
----------------
brevzin wrote:

Done. I just added the C++23 line too, since the test starts at C++11. 

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


More information about the cfe-commits mailing list