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

Shafik Yaghmour via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Apr 17 14:03:48 PDT 2023


shafik added a comment.

I am mostly done but others should also look at this.



================
Comment at: clang/lib/Sema/SemaInit.cpp:5348
+      };
+      ExprResult ER = CreateExprResult();
+      if (InitExpr)
----------------
Why not just use a conditional expression here or alternatively just turn it into an IIILE?


================
Comment at: clang/lib/Sema/SemaInit.cpp:5394
+    ResultType = S.Context.getConstantArrayType(
+        AT->getElementType(), llvm::APInt(/*numBits=*/32, ArrayLength), nullptr,
+        ArrayType::Normal, 0);
----------------



================
Comment at: clang/lib/Sema/SemaInit.cpp:5421
+          InitializationKind SubKind = InitializationKind::CreateValue(
+              Kind.getLocation(), Kind.getLocation(), Kind.getLocation(), true);
+          if (!HandleInitializedEntity(SubEntity, SubKind, nullptr))
----------------



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