diff options
author | Douglas Gregor <dgregor@apple.com> | 2010-08-07 12:29:18 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2010-08-07 12:29:18 +0000 |
commit | 59c451ef236ec5af8fecc7291f5cb87a3ea6e799 (patch) | |
tree | 09162480c09ef39d115cac94c42ba7a7bb79f429 | |
parent | aaa37137a94f61747076d7431ef129aa497c92ed (diff) |
Fix an Objective-C crasher, PR7839.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110515 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/Sema/SemaDeclObjC.cpp | 3 | ||||
-rw-r--r-- | test/SemaObjC/protocols.m | 4 |
2 files changed, 6 insertions, 1 deletions
diff --git a/lib/Sema/SemaDeclObjC.cpp b/lib/Sema/SemaDeclObjC.cpp index 06f3642c27..9e0d250536 100644 --- a/lib/Sema/SemaDeclObjC.cpp +++ b/lib/Sema/SemaDeclObjC.cpp @@ -1532,7 +1532,8 @@ Sema::DeclPtrTy Sema::ActOnMethodDeclaration( Param->setInvalidDecl(); } Param->setDeclContext(ObjCMethod); - IdResolver.RemoveDecl(Param); + if (Param->getDeclName()) + IdResolver.RemoveDecl(Param); Params.push_back(Param); } diff --git a/test/SemaObjC/protocols.m b/test/SemaObjC/protocols.m index 8447fe2aad..ca38f20fbd 100644 --- a/test/SemaObjC/protocols.m +++ b/test/SemaObjC/protocols.m @@ -61,3 +61,7 @@ @protocol B < A > // expected-error{{protocol has circular dependency}} @end +@protocol P +- (int)test:(int)param, ..; // expected-warning{{type specifier missing}} \ + // expected-error{{expected ';' after method prototype}} +@end |