summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--clang/Sema/SemaDecl.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/Sema/SemaDecl.cpp b/clang/Sema/SemaDecl.cpp
index aba5b421928..b14e20b2c37 100644
--- a/clang/Sema/SemaDecl.cpp
+++ b/clang/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<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;
OpenPOWER on IntegriCloud