diff options
-rw-r--r-- | decl.c | 2 | ||||
-rw-r--r-- | test/typeof-decay.c | 2 | ||||
-rw-r--r-- | test/typeof-decay.qbe | 1 |
3 files changed, 5 insertions, 0 deletions
@@ -345,6 +345,8 @@ declspecs(struct scope *s, enum storageclass *sc, enum funcspec *fs, int *align) t = typename(s, &tq); if (!t) { e = expr(s); + if (e->decayed) + e = e->unary.base; t = e->type; tq |= e->qual; delexpr(e); diff --git a/test/typeof-decay.c b/test/typeof-decay.c new file mode 100644 index 0000000..1e38d82 --- /dev/null +++ b/test/typeof-decay.c @@ -0,0 +1,2 @@ +char a[4]; +__typeof__(a) a; diff --git a/test/typeof-decay.qbe b/test/typeof-decay.qbe new file mode 100644 index 0000000..8992e9b --- /dev/null +++ b/test/typeof-decay.qbe @@ -0,0 +1 @@ +export data $a = align 1 { z 4 } |