[PATCH] D43689: [analyzer] Disable constructor inlining when lifetime extension through fields occurs.
Artem Dergachev via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Sat Feb 24 14:02:01 PST 2018
NoQ added inline comments.
================
Comment at: lib/StaticAnalyzer/Core/ExprEngineCXX.cpp:177
+ assert(VD->getType()->isReferenceType());
+ if (VD->getType()->getPointeeType().getCanonicalType() !=
+ MTE->GetTemporaryExpr()->getType().getCanonicalType()) {
----------------
dcoughlin wrote:
> I *think* this is safe. But it seems like it would be more direct to use skipRValueSubobjectAdjustments() and check for sub-object adjustments since ultimately that is what you care about, right?
> skipRValueSubobjectAdjustments()
This function doesn't do anything anymore (since rC288563) (in most cases, at least). We now have lvalue sub-objects adjustments that are outside of `MaterializeTemporaryExpr`, and i'm trying to see if there are any by comparing the variable type with the temporary type. If there are still any rvalue sub-object adjustments present in the AST, then i'd have to skip them, as an additional step.
Repository:
rC Clang
https://reviews.llvm.org/D43689
More information about the cfe-commits
mailing list