[PATCH] D70755: [LifetimeAnalysis] Fix PR44150

Gábor Horváth via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 26 17:11:45 PST 2019


xazax.hun created this revision.
xazax.hun added reviewers: gribozavr, mgehre.
xazax.hun added a project: clang.
Herald added subscribers: Szelethus, Charusso, gamesh411, dkrupp, rnkovacs.

We really wanted to avoid special handling of references but it looks like this is inevitable.

The main difference is the following, if you copy a gsl::Pointer, like an iterator, the result will dangle if and only if the original instance would dangle as well. Basically the copy just propagates the points-to set. But this is not the case for references.  If we create an object from a reference it is often more similar to a dereference operation, or an LValueToRValue cast. This patch attempts to address this difference.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D70755

Files:
  clang/lib/Sema/SemaInit.cpp
  clang/test/Sema/warn-lifetime-analysis-nocfg.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D70755.231155.patch
Type: text/x-patch
Size: 4586 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20191127/90aaab31/attachment.bin>


More information about the cfe-commits mailing list