aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2019-04-20 11:18:00 -0700
committerMichael Forney <mforney@mforney.org>2019-04-23 15:19:55 -0700
commit00d412a140c0d9d5bd08d61032a9f15385eceac7 (patch)
treec0322f1f3a2092a36a13d4e587908f06a2a148d3
parente848987b92d22624885ab6c6c525f02717110e00 (diff)
downloadcproc-00d412a140c0d9d5bd08d61032a9f15385eceac7.tar.xz
expr: Check qualifiers when parsing ++/-- expressions
-rw-r--r--expr.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/expr.c b/expr.c
index da4dd2b..165c7f8 100644
--- a/expr.c
+++ b/expr.c
@@ -660,10 +660,8 @@ unaryexpr(struct scope *s)
l = unaryexpr(s);
if (!l->lvalue)
error(&tok.loc, "operand of %srement operator must be an lvalue", op == TINC ? "inc" : "dec");
- /*
- if (l->qualifiers & QUALCONST)
+ if (l->qual & QUALCONST)
error(&tok.loc, "operand of %srement operator is const qualified", op == TINC ? "inc" : "dec");
- */
e = mkexpr(EXPRINCDEC, l->type);
e->incdec.op = op;
e->incdec.base = l;