]> granicus.if.org Git - clang/commitdiff
Revert "objective-C: warn if selector has nothing but bare"
authorTed Kremenek <kremenek@apple.com>
Wed, 12 Sep 2012 16:50:30 +0000 (16:50 +0000)
committerTed Kremenek <kremenek@apple.com>
Wed, 12 Sep 2012 16:50:30 +0000 (16:50 +0000)
We plan on discussing this more.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@163719 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Basic/DiagnosticParseKinds.td
lib/Parse/ParseObjc.cpp
test/SemaObjC/warn-missing-selector-arg-name.m

index ccdea4aabbb313667c4ffd1142fa3a13dad9a9ad..5f8e8aa3ac866666a951df4650d437c3d5a0fe0f 100644 (file)
@@ -361,9 +361,6 @@ def warn_missing_argument_name : Warning<
   "no parameter name in the middle of a selector"
   " may result in incomplete selector name">,
   InGroup<DiagGroup<"missing-argument-name-in-selector">>, DefaultIgnore;
-def warn_selector_with_bare_colon : Warning<
-  "selector has only bare colons in its name">,
-  InGroup<DiagGroup<"selector-with-bare-colons">>, DefaultIgnore;
 def note_missing_argument_name : Note<
   "did you mean %0 as the selector name">;
 
index 2bcb7a786ab4cfa98183f05b63e19ef5da712e1b..6d5f35a7993772f91b8744994a8b0a4455d6c07f 100644 (file)
@@ -1032,7 +1032,6 @@ Decl *Parser::ParseObjCMethodDecl(SourceLocation mLoc,
 
   AttributePool allParamAttrs(AttrFactory);
   bool warnSelectorName = false;
-  bool warnHasNoName = true;
   while (1) {
     ParsedAttributes paramAttrs(AttrFactory);
     Sema::ObjCArgInfo ArgInfo;
@@ -1110,8 +1109,7 @@ Decl *Parser::ParseObjCMethodDecl(SourceLocation mLoc,
       Diag(Tok, diag::warn_missing_argument_name); // missing argument name.
       warnSelectorName = true;
     }
-    else
-      warnHasNoName = false;
+    
     // We have a selector or a colon, continue parsing.
   }
 
@@ -1152,11 +1150,8 @@ Decl *Parser::ParseObjCMethodDecl(SourceLocation mLoc,
   
   Selector Sel = PP.getSelectorTable().getSelector(KeyIdents.size(),
                                                    &KeyIdents[0]);
-  if (warnSelectorName) {
-    if (warnHasNoName)
-      Diag(mLoc, diag::warn_selector_with_bare_colon);
+  if (warnSelectorName)
     Diag(mLoc, diag::note_missing_argument_name) << Sel.getAsString();
-  }
   
   Decl *Result
        = Actions.ActOnMethodDeclaration(getCurScope(), mLoc, Tok.getLocation(),
index 3d2a75a1eb5a4289a86ed93f4702917ce9addce4..97bcd0db91df07b0b6a2ac1c704251c151b0ba74 100644 (file)
@@ -1,15 +1,11 @@
-// RUN: %clang_cc1  -fsyntax-only -verify -Wselector-with-bare-colons -Wmissing-argument-name-in-selector %s
-// RUN: %clang_cc1 -x objective-c++ -fsyntax-only -verify -Wselector-with-bare-colons -Wmissing-argument-name-in-selector %s
-// rdar://8366823
+// RUN: %clang_cc1  -fsyntax-only -verify -Wno-objc-root-class -Wmissing-argument-name-in-selector %s
+// RUN: %clang_cc1 -x objective-c++ -fsyntax-only -verify -Wno-objc-root-class -Wmissing-argument-name-in-selector %s
 // rdar://12263549
 
 @interface Super @end
 @interface INTF : Super
-- (void) MMM;
-- (void)bar:(id)b;
 -(void) Name1:(id)Arg1 Name2:(id)Arg2; // Name1:Name2:
 -(void) Name1:(id) Name2:(id)Arg2; // expected-warning {{no parameter name in the middle of a selector may result in incomplete selector name}} \
-                                   // expected-warning {{selector has only bare colons in its name}} \
                                    // expected-note {{did you mean Name1:: as the selector name}}
 -(void) Name1:(id)Arg1 Name2:(id)Arg2 Name3:(id)Arg3; // Name1:Name2:Name3:
 -(void) Name1:(id)Arg1 Name2:(id) Name3:(id)Arg3; // expected-warning {{no parameter name in the middle of a selector may result in incomplete selector name}} \
 @end
 
 @implementation INTF
-- (void) MMM{}
-- (void)bar:(id)b{}
 -(void) Name1:(id)Arg1 Name2:(id)Arg2{}
 -(void) Name1:(id) Name2:(id)Arg2 {} // expected-warning {{no parameter name in the middle of a selector may result in incomplete selector name}} \
-                                     // expected-warning {{selector has only bare colons in its name}} \
                                     // expected-note {{did you mean Name1:: as the selector name}}
 -(void) Name1:(id)Arg1 Name2:(id)Arg2 Name3:(id)Arg3 {}
 -(void) Name1:(id)Arg1 Name2:(id) Name3:(id)Arg3 {} // expected-warning {{no parameter name in the middle of a selector may result in incomplete selector name}} \