r204965 - Objective-C. Make multiple selector warning
Fariborz Jahanian
fjahanian at apple.com
Thu Mar 27 14:59:02 PDT 2014
Author: fjahanian
Date: Thu Mar 27 16:59:01 2014
New Revision: 204965
URL: http://llvm.org/viewvc/llvm-project?rev=204965&view=rev
Log:
Objective-C. Make multiple selector warning
an opt-in option under -Wselector-type-mismatch.
// rdar://16445728
Modified:
cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
cfe/trunk/lib/Sema/SemaExprObjC.cpp
cfe/trunk/test/SemaObjC/selector-1.m
Modified: cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td?rev=204965&r1=204964&r2=204965&view=diff
==============================================================================
--- cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td (original)
+++ cfe/trunk/include/clang/Basic/DiagnosticSemaKinds.td Thu Mar 27 16:59:01 2014
@@ -905,8 +905,9 @@ def warn_unimplemented_selector: Warnin
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">;
Modified: cfe/trunk/lib/Sema/SemaExprObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExprObjC.cpp?rev=204965&r1=204964&r2=204965&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaExprObjC.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExprObjC.cpp Thu Mar 27 16:59:01 2014
@@ -1003,8 +1003,8 @@ static bool HelperToDiagnoseMismatchedMe
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;
Modified: cfe/trunk/test/SemaObjC/selector-1.m
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/SemaObjC/selector-1.m?rev=204965&r1=204964&r2=204965&view=diff
==============================================================================
--- cfe/trunk/test/SemaObjC/selector-1.m (original)
+++ cfe/trunk/test/SemaObjC/selector-1.m Thu Mar 27 16:59:01 2014
@@ -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}}
More information about the cfe-commits
mailing list