Debian Codegraph @

gcc/testsuite/objc.dg/type-size-5.m

raw
1 /* Reject ivars that use flexible array members. */
2 /* Contributed by Nicola Pero <[email protected]> */
3 /* { dg-do compile } */
4 /* { dg-additional-options "-Wno-objc-root-class" } */
5
6 typedef struct
7 {
8 unsigned long int a;
9 double b[];
10 } test_type;
11
12 @interface Test
13 {
14 double a[]; /* { dg-error "instance variable .a. has unknown size" } */
15 struct { int x; double y[]; } b; /* { dg-error "instance variable .b. uses flexible array member" } */
16 test_type c; /* { dg-error "instance variable .c. uses flexible array member" } */
17 test_type d[4]; /* { dg-error "instance variable .d. uses flexible array member" } */
18 union union_type { int x; test_type y; } e; /* { dg-error "instance variable .e. uses flexible array member" } */
19 }
20 @end
21
22 @implementation Test
23 @end