diff options
Diffstat (limited to 'lib/Checker/GRExprEngine.cpp')
-rw-r--r-- | lib/Checker/GRExprEngine.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/Checker/GRExprEngine.cpp b/lib/Checker/GRExprEngine.cpp index 2977835f82..549f7d9f8b 100644 --- a/lib/Checker/GRExprEngine.cpp +++ b/lib/Checker/GRExprEngine.cpp @@ -2506,9 +2506,12 @@ void GRExprEngine::VisitDeclStmt(const DeclStmt *DS, ExplodedNode *Pred, // time a function is called those values may not be current. ExplodedNodeSet Tmp; - if (InitEx) - Visit(InitEx, Pred, Tmp); - else + if (InitEx) { + if (VD->getType()->isReferenceType() && !InitEx->isLValue()) { + CreateCXXTemporaryObject(InitEx, Pred, Tmp); + } else + Visit(InitEx, Pred, Tmp); + } else Tmp.Add(Pred); ExplodedNodeSet Tmp2; |