summaryrefslogtreecommitdiffstats
path: root/clang/Sema/SemaDecl.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2008-02-16 01:20:36 +0000
committerChris Lattner <sabre@nondot.org>2008-02-16 01:20:36 +0000
commit27055194b769d52c89fead4a4dc3614266fa59ba (patch)
tree76a132240e2cf42693d542eb40b40f7f19a410a3 /clang/Sema/SemaDecl.cpp
parent3ea23a45d97a38fdd893ad2738e3bb2dddaf10ff (diff)
downloadbcm5719-llvm-27055194b769d52c89fead4a4dc3614266fa59ba.tar.gz
bcm5719-llvm-27055194b769d52c89fead4a4dc3614266fa59ba.zip
Fix CheckEndOfDirective to diagnose lines that contain macros that expand to
zero tokens. This fixes PR2045, thanks to Neil for finding another incredibly subtle corner case :) llvm-svn: 47203
Diffstat (limited to 'clang/Sema/SemaDecl.cpp')
-rw-r--r--clang/Sema/SemaDecl.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/clang/Sema/SemaDecl.cpp b/clang/Sema/SemaDecl.cpp
index 2f866c04975..61de36faf69 100644
--- a/clang/Sema/SemaDecl.cpp
+++ b/clang/Sema/SemaDecl.cpp
@@ -1032,8 +1032,7 @@ Sema::DeclTy *Sema::ActOnStartOfFunctionDef(Scope *FnBodyScope, Declarator &D) {
}
}
Decl *decl = static_cast<Decl*>(ActOnDeclarator(GlobalScope, D, 0));
- FunctionDecl *FD = dyn_cast<FunctionDecl>(decl);
- assert(FD != 0 && "ActOnDeclarator() didn't return a FunctionDecl");
+ FunctionDecl *FD = cast<FunctionDecl>(decl);
CurFunctionDecl = FD;
// Create Decl objects for each parameter, adding them to the FunctionDecl.
OpenPOWER on IntegriCloud