~mcf/cproc

aefb830ede6316f5fcf4c3c48b79a661c66c9f2e — Michael Forney a month ago 673a92c
decl: Fix typedefs with type qualifiers

Previously, the qualifiers were saved, but accidentally ignored
when the typedef was referenced.
3 files changed, 5 insertions(+), 0 deletions(-)

M decl.c
A test/typedef-qual.c
A test/typedef-qual.qbe
M decl.c => decl.c +1 -0
@@ 349,6 349,7 @@ declspecs(struct scope *s, enum storageclass *sc, enum funcspec *fs, int *align)
			if (!d || d->kind != DECLTYPE)
				goto done;
			t = d->type;
			tq |= d->qual;
			++ntypes;
			next();
			break;

A test/typedef-qual.c => test/typedef-qual.c +3 -0
@@ 0,0 1,3 @@
typedef const int T;
const int x;
T x;

A test/typedef-qual.qbe => test/typedef-qual.qbe +1 -0
@@ 0,0 1,1 @@
export data $x = align 4 { z 4 }