[cfe-commits] r46980 - /cfe/trunk/Sema/SemaDecl.cpp
Steve Naroff
snaroff at apple.com
Mon Feb 11 17:09:37 PST 2008
Author: snaroff
Date: Mon Feb 11 19:09:36 2008
New Revision: 46980
URL: http://llvm.org/viewvc/llvm-project?rev=46980&view=rev
Log:
Fix unsafe static cast...
Modified:
cfe/trunk/Sema/SemaDecl.cpp
Modified: cfe/trunk/Sema/SemaDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Sema/SemaDecl.cpp?rev=46980&r1=46979&r2=46980&view=diff
==============================================================================
--- cfe/trunk/Sema/SemaDecl.cpp (original)
+++ cfe/trunk/Sema/SemaDecl.cpp Mon Feb 11 19:09:36 2008
@@ -1052,8 +1052,8 @@
Diag(FD->getLocation(), diag::err_previous_definition);
}
}
- FunctionDecl *FD =
- static_cast<FunctionDecl*>(ActOnDeclarator(GlobalScope, D, 0));
+ Decl *decl = static_cast<Decl*>(ActOnDeclarator(GlobalScope, D, 0));
+ FunctionDecl *FD = dyn_cast<FunctionDecl>(decl);
assert(FD != 0 && "ActOnDeclarator() didn't return a FunctionDecl");
CurFunctionDecl = FD;
More information about the cfe-commits
mailing list