diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2015-01-18 16:23:48 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2015-01-18 16:23:48 +0000 |
commit | 06d4ba388873e6d1cfa9cd715a8935ecc8cd2097 (patch) | |
tree | 3eb853da77d46cc77c4b017525a422f9ddb1385b /test/SemaObjC/protocol-expr-neg-1.m | |
parent | 30d791273d07fac9c0c1641a0731191bca6e8606 (diff) | |
download | src-vendor/clang/clang-release_360-r226102.tar.gz src-vendor/clang/clang-release_360-r226102.zip |
Vendor import of clang RELEASE_360/rc1 tag r226102 (effectively, 3.6.0 RC1):vendor/clang/clang-release_360-r226102
Diffstat (limited to 'test/SemaObjC/protocol-expr-neg-1.m')
-rw-r--r-- | test/SemaObjC/protocol-expr-neg-1.m | 19 |
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}} +} |