Merge from mainline (165734:167278).
[official-gcc/graphite-test-results.git] / gcc / testsuite / objc.dg / invalid-type-1.m
blobb8609f8c8310a0d308129791142b38deaba06c02
1 /* Contributed by Nicola Pero <nicola.pero@meta-innovation.com>, November 2010.  */
2 /* { dg-do compile } */
3 #include <objc/objc.h>
5 typedef int Integer;
7 @class MyClass;
9 typedef MyClass AClass;
11 @protocol MyProtocol
12 - (void) method;
13 @end
15 Class <MyProtocol> class_object; /* This is fine.  */
17 id <MyProtocol> object; /* This is fine.  */
19 AClass <MyProtocol> *object1; /* This is fine.  */
21 Integer <MyProtocol> *object2; /* { dg-error "only Objective-C object types can be qualified with a protocol" } */
23 Integer <NonExistingProtocol> *object3; /* { dg-error "only Objective-C object types can be qualified with a protocol" } */
24 /* { dg-error "cannot find protocol" "" { target *-*-* } 23 } */