OSDN Git Service

In gcc/objc/:
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / objc.dg / type-size-5.m
1 /* Reject ivars that use flexible array members.  */
2 /* Contributed by Nicola Pero  <nicola.pero@meta-innovation.com> */
3 /* { dg-do compile } */
4
5 typedef struct
6 {
7   unsigned long int a;
8   double b[];
9 } test_type;
10
11 @interface Test
12 {
13   double a[];                                 /* { dg-error "instance variable .a. has unknown size" } */
14   struct { int x; double y[]; } b;            /* { dg-error "instance variable .b. uses flexible array member" } */
15   test_type c;                                /* { dg-error "instance variable .c. uses flexible array member" } */
16   test_type d[4];                             /* { dg-error "instance variable .d. uses flexible array member" } */
17   union union_type { int x; test_type y; } e; /* { dg-error "instance variable .e. uses flexible array member" } */
18 }
19 @end
20
21 @implementation Test
22 @end