Fix an Objective-C crasher, PR7839.

llvm-svn: 110515
This commit is contained in:
Douglas Gregor 2010-08-07 12:29:18 +00:00
parent 22da8ebafc
commit 114e55df5b
2 changed files with 6 additions and 1 deletions

View File

@ -1532,7 +1532,8 @@ Sema::DeclPtrTy Sema::ActOnMethodDeclaration(
Param->setInvalidDecl(); Param->setInvalidDecl();
} }
Param->setDeclContext(ObjCMethod); Param->setDeclContext(ObjCMethod);
IdResolver.RemoveDecl(Param); if (Param->getDeclName())
IdResolver.RemoveDecl(Param);
Params.push_back(Param); Params.push_back(Param);
} }

View File

@ -61,3 +61,7 @@
@protocol B < A > // expected-error{{protocol has circular dependency}} @protocol B < A > // expected-error{{protocol has circular dependency}}
@end @end
@protocol P
- (int)test:(int)param, ..; // expected-warning{{type specifier missing}} \
// expected-error{{expected ';' after method prototype}}
@end