aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/symbol.c
diff options
Diffstat (limited to 'symbol.c')
-rw-r--r--symbol.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/symbol.c b/symbol.c
index 7060acb6..a4228922 100644
--- a/symbol.c
+++ b/symbol.c
@@ -544,9 +544,12 @@ static struct symbol *examine_pointer_type(struct symbol *sym)
static struct symbol *examine_typeof_helper(struct symbol *sym, bool qual)
{
struct symbol *base = evaluate_expression(sym->initializer);
+ struct ident *as = NULL;
unsigned long mod = 0;
- if (!base)
+ if (base)
+ as = base->ctype.as;
+ else
base = &bad_ctype;
if (base->type == SYM_NODE) {
mod |= base->ctype.modifiers & MOD_TYPEOF;
@@ -559,6 +562,8 @@ static struct symbol *examine_typeof_helper(struct symbol *sym, bool qual)
sym->type = SYM_NODE;
sym->ctype.modifiers = mod;
sym->ctype.base_type = base;
+ if (qual)
+ sym->ctype.as = as;
return examine_node_type(sym);
}