summaryrefslogtreecommitdiffstats
path: root/clang/test/Sema/struct-decl.c
blob: ec006b484f0a1b742ce1fc8df3bdf894d33b1932 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// RUN: clang -fsyntax-only -verify %s
// PR3459
struct bar {
	char n[1];
};

struct foo {
	char name[(int)&((struct bar *)0)->n];
	char name2[(int)&((struct bar *)0)->n - 1]; //expected-error{{fields must have a constant size}}
};

// PR3430
struct s {
        struct st {
                int v;
        } *ts;
};

struct st;

int foo() {
        struct st *f;
        return f->v + f[0].v;
}
OpenPOWER on IntegriCloud