diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Sema/SemaStmt.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/Sema/SemaStmt.cpp b/lib/Sema/SemaStmt.cpp index 9be1d34dae..54ec58af41 100644 --- a/lib/Sema/SemaStmt.cpp +++ b/lib/Sema/SemaStmt.cpp @@ -2035,7 +2035,7 @@ const VarDecl *Sema::getCopyElisionCandidate(QualType ReturnType, // ... the expression is the name of a non-volatile automatic object // (other than a function or catch-clause parameter)) ... const DeclRefExpr *DR = dyn_cast<DeclRefExpr>(E->IgnoreParens()); - if (!DR) + if (!DR || DR->refersToEnclosingLocal()) return 0; const VarDecl *VD = dyn_cast<VarDecl>(DR->getDecl()); if (!VD) |