diff options
author | Alan Zhao <ayzhao@google.com> | 2023-04-13 11:04:59 -0700 |
---|---|---|
committer | Alan Zhao <ayzhao@google.com> | 2023-05-01 10:02:15 -0700 |
commit | 9b4faa11c68be4b45ddf29acd575bb52a3c2fad7 (patch) | |
tree | 043ba87bb3380f2a256984c0446a93314e534948 /llvm/lib/Analysis/LoopAccessAnalysis.cpp | |
parent | 266d65c98a9e80a1e77b09e8042b3a823d46df53 (diff) | |
download | llvm-9b4faa11c68be4b45ddf29acd575bb52a3c2fad7.zip llvm-9b4faa11c68be4b45ddf29acd575bb52a3c2fad7.tar.gz llvm-9b4faa11c68be4b45ddf29acd575bb52a3c2fad7.tar.bz2 |
[clang] Fix overly aggressive lifetime checks for parenthesized aggregate initialization
Before this patch, initialized class members would have the LifetimeKind
LK_MemInitializer, which does not allow for binding a temporary to a
reference. Binding to a temporary however is allowed in parenthesized
aggregate initialization, even if it leads to a dangling reference. To
fix this, we create a new EntityKind, EK_ParenAggInitMember, which has
LifetimeKind LK_FullExpression.
This patch does *not* attempt to diagnose dangling references as a
result of using this feature.
This patch also refactors TryOrBuildParenListInitialization(...) to
accomodate creating different InitializedEntity objects.
Fixes #61567
[0]: https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p0960r3.html
Reviewed By: shafik
Differential Revision: https://reviews.llvm.org/D148274
Diffstat (limited to 'llvm/lib/Analysis/LoopAccessAnalysis.cpp')
0 files changed, 0 insertions, 0 deletions