diff options
-rw-r--r-- | init.c | 2 | ||||
-rw-r--r-- | tests/const-init.c | 1 | ||||
-rw-r--r-- | tests/const-init.qbe | 1 |
3 files changed, 3 insertions, 1 deletions
@@ -211,7 +211,7 @@ parseinit(struct scope *s, struct type *t) p.cur = NULL; p.sub = p.obj; p.sub->offset = 0; - p.sub->type = t; + p.sub->type = typeunqual(t, NULL); for (;;) { if (p.cur) { if (tok.kind == TLBRACK || tok.kind == TPERIOD) diff --git a/tests/const-init.c b/tests/const-init.c new file mode 100644 index 0000000..4d33888 --- /dev/null +++ b/tests/const-init.c @@ -0,0 +1 @@ +const struct {struct {int x, y;} t;} s = {{{1}, 2}}; diff --git a/tests/const-init.qbe b/tests/const-init.qbe new file mode 100644 index 0000000..fb5d305 --- /dev/null +++ b/tests/const-init.qbe @@ -0,0 +1 @@ +export data $s = align 4 { w 1, w 2, } |