Fix <rdar://problem/6505139> [clang on growl]: need to allow unnamed selectors as the first argument

llvm-svn: 64320
This commit is contained in:
Steve Naroff 2009-02-11 20:43:13 +00:00
parent 298a2946f1
commit 7a54c0d7d4
2 changed files with 10 additions and 1 deletions

View File

@ -687,7 +687,8 @@ Parser::DeclTy *Parser::ParseObjCMethodDecl(SourceLocation mLoc,
SourceLocation selLoc;
IdentifierInfo *SelIdent = ParseObjCSelector(selLoc);
if (!SelIdent) { // missing selector name.
// An unnamed colon is valid.
if (!SelIdent && Tok.isNot(tok::colon)) { // missing selector name.
Diag(Tok, diag::err_expected_selector_for_method)
<< SourceRange(mLoc, Tok.getLocation());
// Skip until we get a ; or {}.

View File

@ -1,5 +1,13 @@
// RUN: clang -verify %s
@interface Lancelot @end
@implementation Lancelot
- (void):(int)x {}
- (void)xx:(int)x :(int)y { }
@end
int main() {
SEL s = @selector(retain);
SEL s1 = @selector(meth1:);