]> granicus.if.org Git - clang/commitdiff
Compute Type dependent-ness of BlockDeclRefExpr
authorFariborz Jahanian <fjahanian@apple.com>
Mon, 12 Jul 2010 18:12:03 +0000 (18:12 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Mon, 12 Jul 2010 18:12:03 +0000 (18:12 +0000)
on the fly when constructing it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108166 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/Expr.h
lib/Sema/SemaExpr.cpp

index 5cf285bad05a73972275f2a4651eb8c97c47c712..807644349e567730f1dc3cab83c03ed24ada388f 100644 (file)
@@ -3398,9 +3398,8 @@ public:
   // FIXME: Fix type/value dependence!
   BlockDeclRefExpr(ValueDecl *d, QualType t, SourceLocation l, bool ByRef,
                    bool constAdded = false,
-                   Stmt *copyConstructorVal = 0,
-                   bool hasDependentType = false)
-  : Expr(BlockDeclRefExprClass, t, hasDependentType, false), 
+                   Stmt *copyConstructorVal = 0)
+  : Expr(BlockDeclRefExprClass, t, (!t.isNull() && t->isDependentType()),false), 
     D(d), Loc(l), IsByRef(ByRef),
     ConstQualAdded(constAdded),  CopyConstructorVal(copyConstructorVal) {}
 
index 53886e108e2a964cf8836a57ac95978610f03aeb..9f9858001e621a42b1094c082b767283b654deb5 100644 (file)
@@ -1747,8 +1747,7 @@ Sema::BuildDeclarationNameExpr(const CXXScopeSpec &SS,
     QualType T = VD->getType();
     BlockDeclRefExpr *BDRE = new (Context) BlockDeclRefExpr(VD, 
                                                             ExprTy, Loc, false,
-                                                            constAdded, 0,
-                          (getLangOptions().CPlusPlus && T->isDependentType()));
+                                                            constAdded);
     if (getLangOptions().CPlusPlus) {
       if (!T->isDependentType() && !T->isReferenceType()) {
         Expr *E = new (Context)