]> granicus.if.org Git - clang/commitdiff
Revert "objective-C: warn under a flag if missing argument"
authorTed Kremenek <kremenek@apple.com>
Wed, 12 Sep 2012 16:50:35 +0000 (16:50 +0000)
committerTed Kremenek <kremenek@apple.com>
Wed, 12 Sep 2012 16:50:35 +0000 (16:50 +0000)
We plan on discussing this more, but we shouldn't have it in the compiler
in an incomplete state.

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

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

index 5f8e8aa3ac866666a951df4650d437c3d5a0fe0f..e4e339aefc467af7fd47883fa19e0afdf18e168f 100644 (file)
@@ -357,12 +357,6 @@ def err_nsnumber_nonliteral_unary : Error<
 def warn_cstyle_param : Warning<
   "use of C-style parameters in Objective-C method declarations"
   " is deprecated">, InGroup<DeprecatedDeclarations>;
-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 note_missing_argument_name : Note<
-  "did you mean %0 as the selector name">;
 
 let CategoryName = "ARC Parse Issue" in {
 def err_arc_bridge_retain : Error<
index 6d5f35a7993772f91b8744994a8b0a4455d6c07f..977d4d97347089d85d2a113e7ebb254ce51051d9 100644 (file)
@@ -1031,7 +1031,7 @@ Decl *Parser::ParseObjCMethodDecl(SourceLocation mLoc,
                             Scope::FunctionPrototypeScope|Scope::DeclScope);
 
   AttributePool allParamAttrs(AttrFactory);
-  bool warnSelectorName = false;
+  
   while (1) {
     ParsedAttributes paramAttrs(AttrFactory);
     Sema::ObjCArgInfo ArgInfo;
@@ -1100,16 +1100,8 @@ Decl *Parser::ParseObjCMethodDecl(SourceLocation mLoc,
     
     // Check for another keyword selector.
     SelIdent = ParseObjCSelectorPiece(selLoc);
-    if (!SelIdent) {
-      if (Tok.isNot(tok::colon))
-        break;
-      // parameter name was not followed with selector name; as in:
-      // - (void) Meth: (id) Name:(id)Arg2; Issue a warning as user
-      // might have meant: - (void) Meth: (id)Arg1 Name:(id)Arg2;
-      Diag(Tok, diag::warn_missing_argument_name); // missing argument name.
-      warnSelectorName = true;
-    }
-    
+    if (!SelIdent && Tok.isNot(tok::colon))
+      break;
     // We have a selector or a colon, continue parsing.
   }
 
@@ -1150,9 +1142,6 @@ Decl *Parser::ParseObjCMethodDecl(SourceLocation mLoc,
   
   Selector Sel = PP.getSelectorTable().getSelector(KeyIdents.size(),
                                                    &KeyIdents[0]);
-  if (warnSelectorName)
-    Diag(mLoc, diag::note_missing_argument_name) << Sel.getAsString();
-  
   Decl *Result
        = Actions.ActOnMethodDeclaration(getCurScope(), mLoc, Tok.getLocation(),
                                         mType, DSRet, ReturnType, 
diff --git a/test/SemaObjC/warn-missing-selector-arg-name.m b/test/SemaObjC/warn-missing-selector-arg-name.m
deleted file mode 100644 (file)
index 97bcd0d..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-// 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) 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-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}} \
-                                                  // expected-note {{did you mean Name1:Name2:: as the selector name}}
-@end
-
-@implementation INTF
--(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-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}} \
-                                                   // expected-note {{did you mean Name1:Name2:: as the selector name}}
-@end