DeclRefExpr stores a ValueDecl internally.

Template instantiation can re-use DeclRefExprs.

llvm-svn: 90848
diff --git a/clang/lib/CodeGen/CGBlocks.cpp b/clang/lib/CodeGen/CGBlocks.cpp
index 9fc2c1a..9e44db0 100644
--- a/clang/lib/CodeGen/CGBlocks.cpp
+++ b/clang/lib/CodeGen/CGBlocks.cpp
@@ -296,7 +296,7 @@
             ++helpersize;
             continue;
           } else
-            E = new (getContext()) DeclRefExpr (cast<NamedDecl>(VD),
+            E = new (getContext()) DeclRefExpr (VD,
                                                 VD->getType(), 
                                                 SourceLocation());
         }