[PATCH] D148274: [clang] Fix overly aggressive lifetime checks for parenthesized aggregate initialization

Richard Smith - zygoloid via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 26 18:08:43 PDT 2023


rsmith added a comment.

LGTM, I'll leave approval to @shafik :)



================
Comment at: clang/lib/Sema/SemaInit.cpp:5379
+    } else {
       ArrayLength = Args.size();
+    }
----------------
Can we assert that we have an `IncompleteArrayType` here? (That is, that we don't have a `DependentSizedArrayType`.)


================
Comment at: clang/lib/Sema/SemaInit.cpp:5513
+          InitializedEntity SubEntity =
+              InitializedEntity::InitializeMember(FD, &Entity);
+          InitializationKind SubKind = InitializationKind::CreateValue(
----------------
Is there a reason to not use `InitializeMemberFromParenAggInit` here? That'd mean we use the same `InitializedEntity` for every case in this loop, and could pull it out of the individual `if` branches.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D148274



More information about the cfe-commits mailing list