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

via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 11 14:53:55 PDT 2025


================
@@ -1217,6 +1217,9 @@ void CXXRecordDecl::addedMember(Decl *D) {
     // those because they are always unnamed.
     bool IsZeroSize = Field->isZeroSize(Context);
 
+    // P3074
+    const bool TrivialUnion = Context.getLangOpts().CPlusPlus26 && isUnion();
----------------
Sirraide wrote:

I thought it was in our coding standards because I’m used to people pointing this out all the time but https://llvm.org/docs/CodingStandards.html doesn’t seem to have anything to say about it.

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


More information about the cfe-commits mailing list