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 :)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47203 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/Sema/SemaDecl.cpp b/Sema/SemaDecl.cpp
index 2f866c0..61de36f 100644
--- a/Sema/SemaDecl.cpp
+++ b/Sema/SemaDecl.cpp
@@ -1032,8 +1032,7 @@
}
}
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.