2013-10-29 Richard Biener <rguenther@suse.de>
[official-gcc.git] / gcc / testsuite / obj-c++.dg / protocol-forward-1.mm
blob03c7ae065da8cb8716e786aa756a2e357acd9d0e
1 /* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, December 2010.  */
2 /* { dg-do compile } */
4 /* Test that all protocols appearing in @interface declarations are
5    real (ie, we saw a full @protocol definition with list of methods),
6    and not just forward-references (ie, "@protocol NSObject;").  */
8 #include <objc/objc.h>
10 @protocol MyProtocol;
12 @protocol MyProtocol2
13 - (int)method2;
14 @end
16 @interface MyClass <MyProtocol> /* { dg-warning "definition of protocol .MyProtocol. not found" } */
17 @end
19 @interface MyClass2 <MyProtocol2> /* Ok */
20 @end
22 @interface MyClass2 (Category) <MyProtocol>  /* { dg-warning "definition of protocol .MyProtocol. not found" } */
23 @end
25 @protocol MyProtocol3 <MyProtocol> /* Ok */
26 @end