cproc

Unnamed repository; edit this file 'description' to name the repository.
git clone git://git.nihaljere.xyz/cproc
Log | Files | Refs | Submodules | README | LICENSE

commit 056de5d46edfd4f5882217248c49fa64a9ecff48
parent 07ca02cc2d0a2137433f29186aa838d68ded7e9a
Author: Michael Forney <mforney@mforney.org>
Date:   Tue, 16 Apr 2019 16:47:53 -0700

Use undecayed type in __typeof__

Diffstat:
Mdecl.c | 2++
Atest/typeof-decay.c | 2++
Atest/typeof-decay.qbe | 1+
3 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/decl.c b/decl.c @@ -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 @@ -0,0 +1,2 @@ +char a[4]; +__typeof__(a) a; diff --git a/test/typeof-decay.qbe b/test/typeof-decay.qbe @@ -0,0 +1 @@ +export data $a = align 1 { z 4 }