aboutsummaryrefslogtreecommitdiff
path: root/test/SemaObjC/protocol-expr-neg-1.m
diff options
context:
space:
mode:
Diffstat (limited to 'test/SemaObjC/protocol-expr-neg-1.m')
-rw-r--r--test/SemaObjC/protocol-expr-neg-1.m19
1 files changed, 17 insertions, 2 deletions
diff --git a/test/SemaObjC/protocol-expr-neg-1.m b/test/SemaObjC/protocol-expr-neg-1.m
index 58ac8c0ca322..aed56c016b08 100644
--- a/test/SemaObjC/protocol-expr-neg-1.m
+++ b/test/SemaObjC/protocol-expr-neg-1.m
@@ -2,7 +2,7 @@
@class Protocol;
-@protocol fproto;
+@protocol fproto; // expected-note {{'fproto' declared here}}
@protocol p1
@end
@@ -12,8 +12,23 @@
int main()
{
Protocol *proto = @protocol(p1);
- Protocol *fproto = @protocol(fproto);
+ Protocol *fproto = @protocol(fproto); // expected-warning {{@protocol is using a forward protocol declaration of fproto}}
Protocol *pp = @protocol(i); // expected-error {{cannot find protocol declaration for 'i'}}
Protocol *p1p = @protocol(cl); // expected-error {{cannot find protocol declaration for 'cl'}}
}
+// rdar://17768630
+@protocol SuperProtocol; // expected-note {{'SuperProtocol' declared here}}
+@protocol TestProtocol; // expected-note {{'TestProtocol' declared here}}
+
+@interface I
+- (int) conformsToProtocol : (Protocol *)protocl;
+@end
+
+int doesConform(id foo) {
+ return [foo conformsToProtocol:@protocol(TestProtocol)]; // expected-warning {{@protocol is using a forward protocol declaration of TestProtocol}}
+}
+
+int doesConformSuper(id foo) {
+ return [foo conformsToProtocol:@protocol(SuperProtocol)]; // expected-warning {{@protocol is using a forward protocol declaration of SuperProtocol}}
+}