summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2010-07-12 17:26:57 +0000
committerFariborz Jahanian <fjahanian@apple.com>2010-07-12 17:26:57 +0000
commit70c0b08022566baf4f9dfd23bb8fa146f3ed0e8d (patch)
tree3109a6078f0b13e07bf4ec1363e08d5838a4e268
parentdbb2806a7b05792c1be5ba3834a3f6663e35e6a8 (diff)
downloadbcm5719-llvm-70c0b08022566baf4f9dfd23bb8fa146f3ed0e8d.tar.gz
bcm5719-llvm-70c0b08022566baf4f9dfd23bb8fa146f3ed0e8d.zip
Move setting of Dependent Type to BlockDeclRefExpr's
constructor. llvm-svn: 108157
-rw-r--r--clang/include/clang/AST/Expr.h6
-rw-r--r--clang/lib/Sema/SemaExpr.cpp7
2 files changed, 7 insertions, 6 deletions
diff --git a/clang/include/clang/AST/Expr.h b/clang/include/clang/AST/Expr.h
index 9d1ba48a356..5cf285bad05 100644
--- a/clang/include/clang/AST/Expr.h
+++ b/clang/include/clang/AST/Expr.h
@@ -3398,8 +3398,10 @@ public:
// FIXME: Fix type/value dependence!
BlockDeclRefExpr(ValueDecl *d, QualType t, SourceLocation l, bool ByRef,
bool constAdded = false,
- Stmt *copyConstructorVal = 0)
- : Expr(BlockDeclRefExprClass, t, false, false), D(d), Loc(l), IsByRef(ByRef),
+ Stmt *copyConstructorVal = 0,
+ bool hasDependentType = false)
+ : Expr(BlockDeclRefExprClass, t, hasDependentType, false),
+ D(d), Loc(l), IsByRef(ByRef),
ConstQualAdded(constAdded), CopyConstructorVal(copyConstructorVal) {}
// \brief Build an empty reference to a declared variable in a
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