[PATCH] D33661: [Sema][ObjC] Don't emit availability diagnostics for categories extending unavailable interfaces
Phabricator via Phabricator via cfe-commits
cfe-commits at lists.llvm.org
Wed May 31 08:46:16 PDT 2017
This revision was automatically updated to reflect the committed changes.
Closed by commit rL304306: [Sema][ObjC] Don't emit availability diags for category @implementations (authored by epilk).
Changed prior to commit:
https://reviews.llvm.org/D33661?vs=100645&id=100869#toc
Repository:
rL LLVM
https://reviews.llvm.org/D33661
Files:
cfe/trunk/lib/Sema/SemaDeclObjC.cpp
cfe/trunk/test/SemaObjC/attr-deprecated.m
cfe/trunk/test/SemaObjC/class-unavail-warning.m
cfe/trunk/test/SemaObjC/warn-deprecated-implementations.m
Index: cfe/trunk/test/SemaObjC/warn-deprecated-implementations.m
===================================================================
--- cfe/trunk/test/SemaObjC/warn-deprecated-implementations.m
+++ cfe/trunk/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
- at implementation CL ( SomeCategory ) // expected-warning {{'CL' is deprecated}} \
- // expected-warning {{Implementing deprecated category}}
+ at implementation CL (SomeCategory) // expected-warning {{Implementing deprecated category}}
@end
@interface CL_SUB : CL // expected-warning {{'CL' is deprecated}}
Index: cfe/trunk/test/SemaObjC/class-unavail-warning.m
===================================================================
--- cfe/trunk/test/SemaObjC/class-unavail-warning.m
+++ cfe/trunk/test/SemaObjC/class-unavail-warning.m
@@ -2,7 +2,7 @@
// rdar://9092208
__attribute__((unavailable("not available")))
- at interface MyClass { // expected-note 8 {{'MyClass' has been explicitly marked unavailable here}}
+ at interface MyClass { // expected-note 7 {{'MyClass' has been explicitly marked unavailable here}}
@public
void *_test;
MyClass *ivar; // no error.
@@ -28,7 +28,7 @@
@interface MyClass (Cat2) // no error.
@end
- at implementation MyClass (Cat2) // expected-error {{unavailable}}
+ at implementation MyClass (Cat2) // no error.
@end
int main() {
Index: cfe/trunk/test/SemaObjC/attr-deprecated.m
===================================================================
--- cfe/trunk/test/SemaObjC/attr-deprecated.m
+++ cfe/trunk/test/SemaObjC/attr-deprecated.m
@@ -83,7 +83,7 @@
}
-__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 @@
@end
@interface DEPRECATED (Category2) // no warning.
+- (id)meth;
@end
- at implementation DEPRECATED (Category2) // expected-warning {{'DEPRECATED' is deprecated}}
+__attribute__((deprecated))
+void depr_function();
+
+ at implementation DEPRECATED (Category2) // no warning
+- (id)meth {
+ depr_function(); // no warning.
+ return 0;
+}
@end
@interface NS : DEPRECATED // expected-warning {{'DEPRECATED' is deprecated}}
Index: cfe/trunk/lib/Sema/SemaDeclObjC.cpp
===================================================================
--- cfe/trunk/lib/Sema/SemaDeclObjC.cpp
+++ cfe/trunk/lib/Sema/SemaDeclObjC.cpp
@@ -1851,10 +1851,6 @@
// 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>()) {
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D33661.100869.patch
Type: text/x-patch
Size: 3369 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20170531/b2761f3a/attachment-0001.bin>
More information about the cfe-commits
mailing list