summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaObjC/deprecated-objc-introspection.m
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2013-06-24 21:35:39 +0000
committerTed Kremenek <kremenek@apple.com>2013-06-24 21:35:39 +0000
commit009d61dd16b45f470bec9a2cedb94f1b75218b67 (patch)
tree9c5e538b25ec6a835fa2610bda420070a4ad0150 /clang/test/SemaObjC/deprecated-objc-introspection.m
parent40b6bf6f46299f4e9f375058ab7a31dafd612560 (diff)
downloadbcm5719-llvm-009d61dd16b45f470bec9a2cedb94f1b75218b67.tar.gz
bcm5719-llvm-009d61dd16b45f470bec9a2cedb94f1b75218b67.zip
Tweak -Wdeprecated-objc-pointer-introspection to have a subgroup for results of using -performSelectorXXX.
-performSelector: and friends return a value that is boxed as an Objective-C pointer. Sometimes it is an Objective-C pointer, sometimes it isn't. Some clients may wish to silence this warning based on calling this method. Fixes <rdar://problem/14147304> llvm-svn: 184789
Diffstat (limited to 'clang/test/SemaObjC/deprecated-objc-introspection.m')
-rw-r--r--clang/test/SemaObjC/deprecated-objc-introspection.m7
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/test/SemaObjC/deprecated-objc-introspection.m b/clang/test/SemaObjC/deprecated-objc-introspection.m
index faaef254d59..4f748414586 100644
--- a/clang/test/SemaObjC/deprecated-objc-introspection.m
+++ b/clang/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
OpenPOWER on IntegriCloud