aboutsummaryrefslogtreecommitdiff
path: root/test/SemaObjC/class-message-protocol-lookup.m
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaObjC/class-message-protocol-lookup.m')
-rw-r--r--test/SemaObjC/class-message-protocol-lookup.m27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/SemaObjC/class-message-protocol-lookup.m b/test/SemaObjC/class-message-protocol-lookup.m
index 37df7a641673..d9f954dc473d 100644
--- a/test/SemaObjC/class-message-protocol-lookup.m
+++ b/test/SemaObjC/class-message-protocol-lookup.m
@@ -32,3 +32,30 @@ int main ()
Class<Test2Protocol> c2 = [c2 alloc]; // ok
return 0;
}
+
+// rdar://22812517
+
+@protocol NSObject
+
+- (int)respondsToSelector:(SEL)aSelector;
+
+@end
+
+__attribute__((objc_root_class))
+@interface NSObject <NSObject>
+
+@end
+
+@protocol OtherProto
+
+- (void)otherInstanceMethod; // expected-note {{method 'otherInstanceMethod' declared here}}
+
+@end
+
+@protocol MyProto <NSObject, OtherProto>
+@end
+
+void allowInstanceMethodsFromRootProtocols(Class<MyProto> c) {
+ [c respondsToSelector: @selector(instanceMethod)]; // no warning
+ [c otherInstanceMethod]; // expected-warning {{instance method 'otherInstanceMethod' found instead of class method 'otherInstanceMethod'}}
+}