[PATCH] D100057: Remove warning "suggest braces" for aggregate initialization of an empty class with an aggregate base class.

Michael Schellenberger Costa via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 7 11:49:54 PDT 2021


miscco added inline comments.


================
Comment at: clang/lib/Sema/SemaInit.cpp:1013
 
-  auto *ParentRD =
-      Entity.getParent()->getType()->castAs<RecordType>()->getDecl();
-  if (CXXRecordDecl *CXXRD = dyn_cast<CXXRecordDecl>(ParentRD))
-    if (CXXRD->getNumBases())
-      return false;
+  // Allows elide brace initialization for aggreagates with empty base
+  if (Entity.getKind() == InitializedEntity::EK_Base) {
----------------
There is a typo here `aggreagates` -> `aggregates`


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D100057



More information about the cfe-commits mailing list