diff options
author | Michael Forney <mforney@mforney.org> | 2019-11-19 19:49:50 -0800 |
---|---|---|
committer | Michael Forney <mforney@mforney.org> | 2019-11-19 19:49:50 -0800 |
commit | 3bdc9dc8a2e53cb745e0555dc30f0e2b2df4d444 (patch) | |
tree | 97ad92f0a20701523261aa6d77197ac24bf7ffbe | |
parent | 9a393428186c42b7dc227e3f7a1bc3cbb0c099aa (diff) |
decl: Parse array size as an assignment-expression
Even though we don't support VLAs yet, we should still be parsing the
VLA syntax, then failing after if it was not a constant expression.
-rw-r--r-- | decl.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -565,7 +565,7 @@ declaratortypes(struct scope *s, struct list *result, char **name, bool allowabs i = 0; next(); } else { - e = constexpr(s); + e = eval(assignexpr(s), EVALARITH); if (e->kind != EXPRCONST || !(e->type->prop & PROPINT)) error(&tok.loc, "VLAs are not yet supported"); i = e->constant.i; |