summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExpr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Sema/SemaExpr.cpp')
-rw-r--r--clang/lib/Sema/SemaExpr.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index 57b4232294e..53886e108e2 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/lib/Sema/SemaExpr.cpp
@@ -1744,10 +1744,11 @@ Sema::BuildDeclarationNameExpr(const CXXScopeSpec &SS,
// Variable will be bound by-copy, make it const within the closure.
ExprTy.addConst();
+ QualType T = VD->getType();
BlockDeclRefExpr *BDRE = new (Context) BlockDeclRefExpr(VD,
ExprTy, Loc, false,
- constAdded);
- QualType T = VD->getType();
+ constAdded, 0,
+ (getLangOptions().CPlusPlus && T->isDependentType()));
if (getLangOptions().CPlusPlus) {
if (!T->isDependentType() && !T->isReferenceType()) {
Expr *E = new (Context)
@@ -1765,8 +1766,6 @@ Sema::BuildDeclarationNameExpr(const CXXScopeSpec &SS,
BDRE->setCopyConstructorExpr(Init);
}
}
- else if (T->isDependentType())
- BDRE->setTypeDependent(true);
}
return Owned(BDRE);
}
OpenPOWER on IntegriCloud