From fabbc34f75960574514225de737f9985ae577112 Mon Sep 17 00:00:00 2001 From: Steve Naroff Date: Tue, 12 Feb 2008 01:09:36 +0000 Subject: [PATCH] Fix unsafe static cast... git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@46980 91177308-0d34-0410-b5e6-96231b3b80d8 --- Sema/SemaDecl.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sema/SemaDecl.cpp b/Sema/SemaDecl.cpp index aba5b42192..b14e20b2c3 100644 --- a/Sema/SemaDecl.cpp +++ b/Sema/SemaDecl.cpp @@ -1052,8 +1052,8 @@ Sema::DeclTy *Sema::ActOnStartOfFunctionDef(Scope *FnBodyScope, Declarator &D) { Diag(FD->getLocation(), diag::err_previous_definition); } } - FunctionDecl *FD = - static_cast(ActOnDeclarator(GlobalScope, D, 0)); + Decl *decl = static_cast(ActOnDeclarator(GlobalScope, D, 0)); + FunctionDecl *FD = dyn_cast(decl); assert(FD != 0 && "ActOnDeclarator() didn't return a FunctionDecl"); CurFunctionDecl = FD; -- 2.50.1