Support taking the address of alias expressions.

Taking the address of an alias expression undoes the alias but uses the
aliased type.
This commit is contained in:
Bill Currie 2011-03-06 15:58:49 +09:00
parent b74c644a10
commit 993d05b3d3
1 changed files with 5 additions and 0 deletions

View File

@ -2123,6 +2123,11 @@ address_expr (expr_t *e1, expr_t *e2, type_t *t)
}
break;
}
if (e1->e.expr.op == 'A') {
if (!t)
t = e1->e.expr.type;
return address_expr (e1->e.expr.e1, e2, t);
}
return error (e1, "invalid type for unary &");
default:
return error (e1, "invalid type for unary &");