]> granicus.if.org Git - clang/commitdiff
Fix an Objective-C crasher, PR7839.
authorDouglas Gregor <dgregor@apple.com>
Sat, 7 Aug 2010 12:29:18 +0000 (12:29 +0000)
committerDouglas Gregor <dgregor@apple.com>
Sat, 7 Aug 2010 12:29:18 +0000 (12:29 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@110515 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Sema/SemaDeclObjC.cpp
test/SemaObjC/protocols.m

index 06f3642c271aa6cf4efb504c45bd29aa0dd4fd31..9e0d250536ff7c648f91535d5b34ba62346f08ab 100644 (file)
@@ -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);
   }
   
index 8447fe2aad2f9340a3a9c0b319ab055cd5c07943..ca38f20fbd0179c6d15847ed9f6e5c8315faf256 100644 (file)
@@ -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