DeclRefExpr stores a ValueDecl internally.

Template instantiation can re-use DeclRefExprs.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90848 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/CGBlocks.cpp b/lib/CodeGen/CGBlocks.cpp
index 9fc2c1a..9e44db0 100644
--- a/lib/CodeGen/CGBlocks.cpp
+++ b/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());
         }