[PATCH] D145851: [Clang][Sema] Fix incorrect deletion of default constructors for some unions

Erich Keane via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 13 07:10:54 PDT 2023


erichkeane added a comment.

Generally looks good to me.  Do we do anything special if there are multiple initializers?  Also, can we have a codegen test that validates that we actually construct it correctly (and perhaps a constexpr test for the same!)?



================
Comment at: clang/lib/Sema/SemaDeclCXX.cpp:9163
+      // members has an explicit initializer.
+      auto* RD = dyn_cast<CXXRecordDecl>(Field->getParent());
+      assert(RD);
----------------
This way you don't need the assert!


================
Comment at: clang/lib/Sema/SemaDeclCXX.cpp:9167
+        DiagKind = 4;
+    } else
+      DiagKind = 4;
----------------
else needs curleys, since its associated 'if' has them.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D145851/new/

https://reviews.llvm.org/D145851



More information about the cfe-commits mailing list