summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorErik Pilkington <erik.pilkington@gmail.com>2017-05-31 15:45:57 +0000
committerErik Pilkington <erik.pilkington@gmail.com>2017-05-31 15:45:57 +0000
commit608164077ec9242ff056cbbaf7e5740126bb2f42 (patch)
tree43c956df24180d89d9f250d93a10a84c8d127c2d
parent4b2f3269ab4103e1acdc94de09058856a75d1434 (diff)
downloadbcm5719-llvm-608164077ec9242ff056cbbaf7e5740126bb2f42.tar.gz
bcm5719-llvm-608164077ec9242ff056cbbaf7e5740126bb2f42.zip
[Sema][ObjC] Don't emit availability diags for category @implementations
These diagnostics can't be disabled, and can't actually catch any bugs. rdar://32427296 Differential revision: https://reviews.llvm.org/D33661 llvm-svn: 304306
-rw-r--r--clang/lib/Sema/SemaDeclObjC.cpp4
-rw-r--r--clang/test/SemaObjC/attr-deprecated.m12
-rw-r--r--clang/test/SemaObjC/class-unavail-warning.m4
-rw-r--r--clang/test/SemaObjC/warn-deprecated-implementations.m5
4 files changed, 14 insertions, 11 deletions
diff --git a/clang/lib/Sema/SemaDeclObjC.cpp b/clang/lib/Sema/SemaDeclObjC.cpp
index 370461c4a24..2c8080dbf02 100644
--- a/clang/lib/Sema/SemaDeclObjC.cpp
+++ b/clang/lib/Sema/SemaDeclObjC.cpp
@@ -1851,10 +1851,6 @@ Decl *Sema::ActOnStartCategoryImplementation(
// FIXME: PushOnScopeChains?
CurContext->addDecl(CDecl);
- // If the interface is deprecated/unavailable, warn/error about it.
- if (IDecl)
- DiagnoseUseOfDecl(IDecl, ClassLoc);
-
// If the interface has the objc_runtime_visible attribute, we
// cannot implement a category for it.
if (IDecl && IDecl->hasAttr<ObjCRuntimeVisibleAttr>()) {
diff --git a/clang/test/SemaObjC/attr-deprecated.m b/clang/test/SemaObjC/attr-deprecated.m
index b0613851dda..28031997af7 100644
--- a/clang/test/SemaObjC/attr-deprecated.m
+++ b/clang/test/SemaObjC/attr-deprecated.m
@@ -83,7 +83,7 @@ int t5() {
}
-__attribute ((deprecated)) // expected-note 2 {{'DEPRECATED' has been explicitly marked deprecated here}}
+__attribute ((deprecated)) // expected-note {{'DEPRECATED' has been explicitly marked deprecated here}}
@interface DEPRECATED {
@public int ivar;
DEPRECATED *ivar2; // no warning.
@@ -98,9 +98,17 @@ __attribute ((deprecated)) // expected-note 2 {{'DEPRECATED' has been explicitly
@end
@interface DEPRECATED (Category2) // no warning.
+- (id)meth;
@end
-@implementation DEPRECATED (Category2) // expected-warning {{'DEPRECATED' is deprecated}}
+__attribute__((deprecated))
+void depr_function();
+
+@implementation DEPRECATED (Category2) // no warning
+- (id)meth {
+ depr_function(); // no warning.
+ return 0;
+}
@end
@interface NS : DEPRECATED // expected-warning {{'DEPRECATED' is deprecated}}
diff --git a/clang/test/SemaObjC/class-unavail-warning.m b/clang/test/SemaObjC/class-unavail-warning.m
index 268d51910b0..f7d8f569ca6 100644
--- a/clang/test/SemaObjC/class-unavail-warning.m
+++ b/clang/test/SemaObjC/class-unavail-warning.m
@@ -2,7 +2,7 @@
// rdar://9092208
__attribute__((unavailable("not available")))
-@interface MyClass { // expected-note 8 {{'MyClass' has been explicitly marked unavailable here}}
+@interface MyClass { // expected-note 7 {{'MyClass' has been explicitly marked unavailable here}}
@public
void *_test;
MyClass *ivar; // no error.
@@ -28,7 +28,7 @@ __attribute__((unavailable("not available")))
@interface MyClass (Cat2) // no error.
@end
-@implementation MyClass (Cat2) // expected-error {{unavailable}}
+@implementation MyClass (Cat2) // no error.
@end
int main() {
diff --git a/clang/test/SemaObjC/warn-deprecated-implementations.m b/clang/test/SemaObjC/warn-deprecated-implementations.m
index 0c341165b0f..df2557b9cd5 100644
--- a/clang/test/SemaObjC/warn-deprecated-implementations.m
+++ b/clang/test/SemaObjC/warn-deprecated-implementations.m
@@ -28,15 +28,14 @@
- (void) G {} // No warning, implementing its own deprecated method
@end
-__attribute__((deprecated)) // expected-note 2 {{'CL' has been explicitly marked deprecated here}}
+__attribute__((deprecated)) // expected-note {{'CL' has been explicitly marked deprecated here}}
@interface CL // expected-note 2 {{class declared here}}
@end
@implementation CL // expected-warning {{Implementing deprecated class}}
@end
-@implementation CL ( SomeCategory ) // expected-warning {{'CL' is deprecated}} \
- // expected-warning {{Implementing deprecated category}}
+@implementation CL (SomeCategory) // expected-warning {{Implementing deprecated category}}
@end
@interface CL_SUB : CL // expected-warning {{'CL' is deprecated}}
OpenPOWER on IntegriCloud