aboutsummaryrefslogtreecommitdiff
path: root/test/SemaObjC/deprecated-objc-introspection.m
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaObjC/deprecated-objc-introspection.m')
-rw-r--r--test/SemaObjC/deprecated-objc-introspection.m7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/SemaObjC/deprecated-objc-introspection.m b/test/SemaObjC/deprecated-objc-introspection.m
index faaef254d596..4f7484145865 100644
--- a/test/SemaObjC/deprecated-objc-introspection.m
+++ b/test/SemaObjC/deprecated-objc-introspection.m
@@ -14,9 +14,11 @@ typedef struct objc_object {
id firstobj;
struct objc_class *isa;
}
+- (id)performSelector:(SEL)aSelector;;
@end
@interface Whatever : NSObject
+self;
+-(id)foo;
@end
static void func() {
@@ -94,4 +96,9 @@ void testBitmasking(NSObject *p) {
(void) (0x1 & ((NSUInteger) p)); // expected-warning {{bitmasking for introspection of Objective-C object pointers is strongly discouraged}}
(void) (((NSUInteger) p) ^ 0x1); // no-warning
(void) (0x1 ^ ((NSUInteger) p)); // no-warning
+ (void) (0x1 & ((NSUInteger) [p performSelector:@selector(foo)])); // expected-warning {{bitmasking for introspection of Objective-C object pointers is strongly discouraged}}
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-objc-pointer-introspection-performSelector"
+ (void) (0x1 & ((NSUInteger) [p performSelector:@selector(foo)])); // no-warning
+#pragma clang diagnostic pop
} \ No newline at end of file