1 // RUN: %clang_cc1 -verify -fsyntax-only -Wno-objc-root-class %s
3 @class I0; // expected-note 2{{forward declaration of class here}}
6 int g0 = sizeof(I0); // expected-error{{invalid application of 'sizeof' to an incomplete type 'I0'}}
10 P = P+5; // expected-error {{arithmetic on a pointer to an incomplete type 'I0'}}
12 return &P[4]; // expected-error{{expected method to read array element not found on object of type 'I0 *'}}
26 int g1[ sizeof(I0) // expected-error {{application of 'sizeof' to interface 'I0' is not supported on this architecture and platform}}
33 // size == 4 (we do not include extended properties in the
35 int g2[ sizeof(I0) // expected-error {{application of 'sizeof' to interface 'I0' is not supported on this architecture and platform}}
46 typedef struct { @defs(I1); } I1_defs; // expected-error {{use of @defs is not supported on this architecture and platform}}
48 // FIXME: This is currently broken due to the way the record layout we
49 // create is tied to whether we have seen synthesized properties. Ugh.
50 // int g3[ sizeof(I1) == 0 ? 1 : -1];
54 P = P+5; // expected-error {{arithmetic on pointer to interface 'I0', which is not a constant size for this architecture and platform}}
55 P = 5+P; // expected-error {{arithmetic on pointer to interface 'I0', which is not a constant size for this architecture and platform}}
56 P = P-5; // expected-error {{arithmetic on pointer to interface 'I0', which is not a constant size for this architecture and platform}}
58 return P[4].x[2]; // expected-error {{expected method to read array element not found on object of type 'I0 *'}}
64 @interface XCAttributeRunDirectNode
67 unsigned long attributeRuns[1024 + sizeof(I)]; // expected-error {{application of 'sizeof' to interface 'I' is not supported on this architecture and platform}}
72 @implementation XCAttributeRunDirectNode
74 - (unsigned long)gatherStats:(id )stats
76 return attributeRuns[i];
87 // Both of these crash clang nicely
88 ++f; // expected-error {{arithmetic on pointer to interface 'Foo', which is not a constant size for this architecture and platform}}
89 --f; // expected-error {{arithmetic on pointer to interface 'Foo', which is not a constant size for this architecture and platform}}