diff options
| author | Chris Lattner <sabre@nondot.org> | 2008-02-16 01:20:36 +0000 |
|---|---|---|
| committer | Chris Lattner <sabre@nondot.org> | 2008-02-16 01:20:36 +0000 |
| commit | 27055194b769d52c89fead4a4dc3614266fa59ba (patch) | |
| tree | 76a132240e2cf42693d542eb40b40f7f19a410a3 /clang/Sema/SemaDecl.cpp | |
| parent | 3ea23a45d97a38fdd893ad2738e3bb2dddaf10ff (diff) | |
| download | bcm5719-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.cpp | 3 |
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. |

