[cfe-commits] r108166 - in /cfe/trunk: include/clang/AST/Expr.h lib/Sema/SemaExpr.cpp

Fariborz Jahanian fjahanian at apple.com
Mon Jul 12 11:12:03 PDT 2010


Author: fjahanian
Date: Mon Jul 12 13:12:03 2010
New Revision: 108166

URL: http://llvm.org/viewvc/llvm-project?rev=108166&view=rev
Log:
Compute Type dependent-ness of BlockDeclRefExpr
on the fly when constructing it.

Modified:
    cfe/trunk/include/clang/AST/Expr.h
    cfe/trunk/lib/Sema/SemaExpr.cpp

Modified: cfe/trunk/include/clang/AST/Expr.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Expr.h?rev=108166&r1=108165&r2=108166&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/Expr.h (original)
+++ cfe/trunk/include/clang/AST/Expr.h Mon Jul 12 13:12:03 2010
@@ -3398,9 +3398,8 @@
   // 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) {}
 

Modified: cfe/trunk/lib/Sema/SemaExpr.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExpr.cpp?rev=108166&r1=108165&r2=108166&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExpr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExpr.cpp Mon Jul 12 13:12:03 2010
@@ -1747,8 +1747,7 @@
     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) 





More information about the cfe-commits mailing list