diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2014-03-27 21:59:01 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2014-03-27 21:59:01 +0000 |
commit | 1c43329e2998ddd94a6b9e65d495ec1f01e600aa (patch) | |
tree | 922ba4ec18633f04366540b418921da21d319fe5 | |
parent | fffa311e9ef8b5be20ef2198c5326dc394a0a93c (diff) | |
download | bcm5719-llvm-1c43329e2998ddd94a6b9e65d495ec1f01e600aa.tar.gz bcm5719-llvm-1c43329e2998ddd94a6b9e65d495ec1f01e600aa.zip |
Objective-C. Make multiple selector warning
an opt-in option under -Wselector-type-mismatch.
// rdar://16445728
llvm-svn: 204965
-rw-r--r-- | clang/include/clang/Basic/DiagnosticSemaKinds.td | 5 | ||||
-rw-r--r-- | clang/lib/Sema/SemaExprObjC.cpp | 4 | ||||
-rw-r--r-- | clang/test/SemaObjC/selector-1.m | 2 |
3 files changed, 6 insertions, 5 deletions
diff --git a/clang/include/clang/Basic/DiagnosticSemaKinds.td b/clang/include/clang/Basic/DiagnosticSemaKinds.td index 9094e9b323f..f7efbbd2efc 100644 --- a/clang/include/clang/Basic/DiagnosticSemaKinds.td +++ b/clang/include/clang/Basic/DiagnosticSemaKinds.td @@ -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">; diff --git a/clang/lib/Sema/SemaExprObjC.cpp b/clang/lib/Sema/SemaExprObjC.cpp index d878179d781..5bffdd1573a 100644 --- a/clang/lib/Sema/SemaExprObjC.cpp +++ b/clang/lib/Sema/SemaExprObjC.cpp @@ -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; diff --git a/clang/test/SemaObjC/selector-1.m b/clang/test/SemaObjC/selector-1.m index faa742616d5..8dedcdb5ea4 100644 --- a/clang/test/SemaObjC/selector-1.m +++ b/clang/test/SemaObjC/selector-1.m @@ -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}} |