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 | 114e55df5bb74759d60446abebc72e4048fe56d9 (patch) | |
tree | ead22bedbf905c15ee1c20680b8a482b8db01f1c /clang | |
parent | 22da8ebafc6c59dae26f9df59e4c293e4bea01a4 (diff) | |
download | bcm5719-llvm-114e55df5bb74759d60446abebc72e4048fe56d9.tar.gz bcm5719-llvm-114e55df5bb74759d60446abebc72e4048fe56d9.zip |
Fix an Objective-C crasher, PR7839.
llvm-svn: 110515
Diffstat (limited to 'clang')
-rw-r--r-- | clang/lib/Sema/SemaDeclObjC.cpp | 3 | ||||
-rw-r--r-- | clang/test/SemaObjC/protocols.m | 4 |
2 files changed, 6 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaDeclObjC.cpp b/clang/lib/Sema/SemaDeclObjC.cpp index 06f3642c271..9e0d250536f 100644 --- a/clang/lib/Sema/SemaDeclObjC.cpp +++ b/clang/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/clang/test/SemaObjC/protocols.m b/clang/test/SemaObjC/protocols.m index 8447fe2aad2..ca38f20fbd0 100644 --- a/clang/test/SemaObjC/protocols.m +++ b/clang/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 |