aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaDeclObjC.cpp
diff options
context:
space:
mode:
authorSteve Naroff <snaroff@apple.com>2008-07-25 17:57:26 +0000
committerSteve Naroff <snaroff@apple.com>2008-07-25 17:57:26 +0000
commit394f3f483fa4e7b472630cfcd03f7840520958c5 (patch)
treecd875ebb42ff560ca5b4613caa52ab0791db68c4 /lib/Sema/SemaDeclObjC.cpp
parent684b9d2d159da52bc858d81bc53a38db7958a158 (diff)
Move fix in r54013 from the parser to sema.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54032 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDeclObjC.cpp')
-rw-r--r--lib/Sema/SemaDeclObjC.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp
index f71f4f4b78..79f1e2d682 100644
--- a/lib/Sema/SemaDeclObjC.cpp
+++ b/lib/Sema/SemaDeclObjC.cpp
@@ -22,8 +22,11 @@ using namespace clang;
/// and user declared, in the method definition's AST.
void Sema::ObjCActOnStartOfMethodDef(Scope *FnBodyScope, DeclTy *D) {
assert(getCurMethodDecl() == 0 && "Method parsing confused");
- ObjCMethodDecl *MDecl = dyn_cast<ObjCMethodDecl>(static_cast<Decl *>(D));
- assert(MDecl != 0 && "Not a method declarator!");
+ ObjCMethodDecl *MDecl = dyn_cast_or_null<ObjCMethodDecl>((Decl *)D);
+
+ // If we don't have a valid method decl, simply return.
+ if (!MDecl)
+ return;
// Allow the rest of sema to find private method decl implementations.
if (MDecl->isInstance())