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

2023-05-01 Thread Alan Zhao via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rG9b4faa11c68b: [clang] Fix overly aggressive lifetime checks for parenthesized aggregate… (authored by ayzhao). Repository: rG LLVM Github

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

2023-05-01 Thread Alan Zhao via Phabricator via cfe-commits
ayzhao updated this revision to Diff 518479. ayzhao added a comment. rebase + fix merge conflicts Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D148274/new/ https://reviews.llvm.org/D148274 Files: clang/docs/ReleaseNotes.rst

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

2023-04-28 Thread Shafik Yaghmour via Phabricator via cfe-commits
shafik accepted this revision. shafik added a comment. This revision is now accepted and ready to land. LGTM Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D148274/new/ https://reviews.llvm.org/D148274

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

2023-04-28 Thread Alan Zhao via Phabricator via cfe-commits
ayzhao updated this revision to Diff 518044. ayzhao added a comment. add release note Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D148274/new/ https://reviews.llvm.org/D148274 Files: clang/docs/ReleaseNotes.rst

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

2023-04-27 Thread Shafik Yaghmour via Phabricator via cfe-commits
shafik added a comment. I need to look at this more carefully but can we add a release note in the meantime Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D148274/new/ https://reviews.llvm.org/D148274

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

2023-04-27 Thread Alan Zhao via Phabricator via cfe-commits
ayzhao updated this revision to Diff 517699. ayzhao marked an inline comment as done. ayzhao added a comment. code review comments + pull in D149301 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D148274/new/

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

2023-04-26 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
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

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

2023-04-26 Thread Alan Zhao via Phabricator via cfe-commits
ayzhao updated this revision to Diff 517250. ayzhao added a comment. add another test Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D148274/new/ https://reviews.llvm.org/D148274 Files: clang/include/clang/Basic/DiagnosticSemaKinds.td

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

2023-04-26 Thread Alan Zhao via Phabricator via cfe-commits
ayzhao updated this revision to Diff 517249. ayzhao added a comment. add another test and fix whitespace Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D148274/new/ https://reviews.llvm.org/D148274 Files:

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

2023-04-26 Thread Alan Zhao via Phabricator via cfe-commits
ayzhao added inline comments. Comment at: clang/lib/Sema/SemaInit.cpp:5364-5368 if (const ConstantArrayType *CAT = S.getASTContext().getAsConstantArrayType(Entity.getType())) ArrayLength = CAT->getSize().getZExtValue(); else ArrayLength =

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

2023-04-26 Thread Alan Zhao via Phabricator via cfe-commits
ayzhao updated this revision to Diff 517246. ayzhao marked 5 inline comments as done. ayzhao added a comment. code review comments + rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D148274/new/ https://reviews.llvm.org/D148274 Files:

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

2023-04-24 Thread Richard Smith - zygoloid via Phabricator via cfe-commits
rsmith added inline comments. Comment at: clang/lib/Sema/SemaInit.cpp:5364-5368 if (const ConstantArrayType *CAT = S.getASTContext().getAsConstantArrayType(Entity.getType())) ArrayLength = CAT->getSize().getZExtValue(); else ArrayLength =

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

2023-04-17 Thread Alan Zhao via Phabricator via cfe-commits
ayzhao updated this revision to Diff 514425. ayzhao marked 3 inline comments as done. ayzhao added a comment. code review comments + rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D148274/new/ https://reviews.llvm.org/D148274 Files:

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

2023-04-17 Thread Shafik Yaghmour via Phabricator via cfe-commits
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

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

2023-04-17 Thread Alan Zhao via Phabricator via cfe-commits
ayzhao updated this revision to Diff 514389. ayzhao marked an inline comment as done. ayzhao added a comment. remove unrelated formatting changes Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D148274/new/ https://reviews.llvm.org/D148274 Files:

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

2023-04-17 Thread Shafik Yaghmour via Phabricator via cfe-commits
shafik added inline comments. Comment at: clang/lib/Sema/SemaInit.cpp:9723 +// initialize this base/member. +CXXConstructorDecl *Constructor = +cast(S.CurContext); This and the changes below looks like unrelated formatting changes.

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

2023-04-17 Thread Alan Zhao via Phabricator via cfe-commits
ayzhao updated this revision to Diff 514291. ayzhao added a comment. rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D148274/new/ https://reviews.llvm.org/D148274 Files: clang/include/clang/Basic/DiagnosticSemaKinds.td

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

2023-04-14 Thread Alan Zhao via Phabricator via cfe-commits
ayzhao updated this revision to Diff 513808. ayzhao added a comment. fix comments Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D148274/new/ https://reviews.llvm.org/D148274 Files: clang/include/clang/Basic/DiagnosticSemaKinds.td

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

2023-04-14 Thread Alan Zhao via Phabricator via cfe-commits
ayzhao added inline comments. Comment at: clang/include/clang/Sema/Initialization.h:509 bool isImplicitMemberInitializer() const { -return getKind() == EK_Member && Variable.IsImplicitFieldInit; +return (getKind() == EK_Member || getKind() == EK_ParenAggInitMember) &&

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

2023-04-14 Thread Alan Zhao via Phabricator via cfe-commits
ayzhao updated this revision to Diff 513805. ayzhao marked 7 inline comments as done. ayzhao added a comment. Address code review comments and (try) to fix Windows bot failure Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D148274/new/

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

2023-04-14 Thread Shafik Yaghmour via Phabricator via cfe-commits
shafik added inline comments. Comment at: clang/lib/Sema/SemaInit.cpp:5332 +if (Arg) + IS.Diagnose(S, SubEntity, SubKind, Arg); +else Do we have tests that trigger this diagnostic and the one right below? Comment at:

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

2023-04-14 Thread Shafik Yaghmour via Phabricator via cfe-commits
shafik added inline comments. Comment at: clang/include/clang/Sema/Initialization.h:400 + static InitializedEntity InitializeMemberFromParenAggInit(FieldDecl *Member) { +return InitializedEntity(Member, nullptr, false, false, true); + }

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

2023-04-13 Thread Alan Zhao via Phabricator via cfe-commits
ayzhao added inline comments. Comment at: clang/include/clang/Basic/DiagnosticSemaKinds.td:2130 + "initializer|a related result|a parameter of CF audited function|a " + "structured binding|a member subobject}0 " "%diff{of type $ with an %select{rvalue|lvalue}2 of type $|"

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

2023-04-13 Thread Alan Zhao via Phabricator via cfe-commits
ayzhao updated this revision to Diff 513377. ayzhao added a comment. fix missing EOF newline Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D148274/new/ https://reviews.llvm.org/D148274 Files: clang/include/clang/Basic/DiagnosticSemaKinds.td

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

2023-04-13 Thread Alan Zhao via Phabricator via cfe-commits
ayzhao created this revision. Herald added a project: All. ayzhao requested review of this revision. Herald added a project: clang. Herald added a subscriber: cfe-commits. Before this patch, initialized class members would have the LifetimeKind LK_MemInitializer, which does not allow for binding