[cfe-commits] r64320 - in /cfe/trunk: lib/Parse/ParseObjc.cpp test/SemaObjC/selector-1.m
Steve Naroff
snaroff at apple.com
Wed Feb 11 12:43:26 PST 2009
Author: snaroff
Date: Wed Feb 11 14:43:13 2009
New Revision: 64320
URL: http://llvm.org/viewvc/llvm-project?rev=64320&view=rev
Log:
Fix <rdar://problem/6505139> [clang on growl]: need to allow unnamed selectors as the first argument
Modified:
cfe/trunk/lib/Parse/ParseObjc.cpp
cfe/trunk/test/SemaObjC/selector-1.m
Modified: cfe/trunk/lib/Parse/ParseObjc.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Parse/ParseObjc.cpp?rev=64320&r1=64319&r2=64320&view=diff
==============================================================================
--- cfe/trunk/lib/Parse/ParseObjc.cpp (original)
+++ cfe/trunk/lib/Parse/ParseObjc.cpp Wed Feb 11 14:43:13 2009
@@ -687,7 +687,8 @@
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 {}.
Modified: cfe/trunk/test/SemaObjC/selector-1.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/selector-1.m?rev=64320&r1=64319&r2=64320&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/selector-1.m (original)
+++ cfe/trunk/test/SemaObjC/selector-1.m Wed Feb 11 14:43:13 2009
@@ -1,5 +1,13 @@
// RUN: clang -verify %s
+ at interface Lancelot @end
+ at implementation Lancelot
+
+- (void):(int)x {}
+- (void)xx:(int)x :(int)y { }
+
+ at end
+
int main() {
SEL s = @selector(retain);
SEL s1 = @selector(meth1:);
More information about the cfe-commits
mailing list