]> granicus.if.org Git - clang/commitdiff
Objective-C. Make multiple selector warning
authorFariborz Jahanian <fjahanian@apple.com>
Thu, 27 Mar 2014 21:59:01 +0000 (21:59 +0000)
committerFariborz Jahanian <fjahanian@apple.com>
Thu, 27 Mar 2014 21:59:01 +0000 (21:59 +0000)
an opt-in option under -Wselector-type-mismatch.
// rdar://16445728

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

include/clang/Basic/DiagnosticSemaKinds.td
lib/Sema/SemaExprObjC.cpp
test/SemaObjC/selector-1.m

index 9094e9b323f385627f7d94d4a01da8ebe6c40c6a..f7efbbd2efcbb60639803d15c69e93d50f110769 100644 (file)
@@ -905,8 +905,9 @@ def warn_unimplemented_selector:  Warning<
 def warn_unimplemented_protocol_method : Warning<
   "method %0 in protocol %1 not implemented">, InGroup<Protocol>;
 def warning_multiple_selectors: Warning<
-  "several methods with selector %0 of mismatched types are found for the @selector expression">,
-  InGroup<SelectorTypeMismatch>;
+  "several methods with selector %0 of mismatched types are found "
+  "for the @selector expression">,
+  InGroup<SelectorTypeMismatch>, DefaultIgnore;
 // C++ declarations
 def err_static_assert_expression_is_not_constant : Error<
   "static_assert expression is not an integral constant expression">;
index d878179d781fb8b608942dcc0134a61d05c11191..5bffdd1573a6ba4434ff96181e8cc8ba2b936f20 100644 (file)
@@ -1003,8 +1003,8 @@ static bool HelperToDiagnoseMismatchedMethodsInGlobalPool(Sema &S,
 
 static void DiagnoseMismatchedSelectors(Sema &S, SourceLocation AtLoc,
                                         ObjCMethodDecl *Method) {
-  unsigned DIAG = diag::warning_multiple_selectors;
-  if (S.Diags.getDiagnosticLevel(DIAG, SourceLocation())
+  if (S.Diags.getDiagnosticLevel(diag::warning_multiple_selectors,
+                                 SourceLocation())
         == DiagnosticsEngine::Ignored)
     return;
   bool Warned = false;
index faa742616d5c35711babe30e86f0c4f14dddf0ee..8dedcdb5ea4b0f873eef4e571f39df247e9ea314 100644 (file)
@@ -1,4 +1,4 @@
-// RUN: %clang_cc1 -verify %s 
+// RUN: %clang_cc1 -Wselector-type-mismatch -verify %s 
 
 @interface I
 - (id) compare: (char) arg1; // expected-note {{method 'compare:' declared here}}