aboutsummaryrefslogtreecommitdiff
path: root/src/parse.cff
diff options
context:
space:
mode:
Diffstat (limited to 'src/parse.cff')
-rw-r--r--src/parse.cff13
1 files changed, 3 insertions, 10 deletions
diff --git a/src/parse.cff b/src/parse.cff
index 364b23b..b978f4b 100644
--- a/src/parse.cff
+++ b/src/parse.cff
@@ -1676,10 +1676,6 @@ fn pexpostfix(P *Parser) Expr {
if ex.ty.konst {
err(P, ex.loc, "left operand to prefix %qT operator is const", tok);
}
- if ex.u.#tag == :BitDot {
- err(P, ex.loc, "cannot apply post-%srement operator to bitfield value",
- tok.t == '++' ? "inc" : "dec");
- }
ex = {
tok.loc, ex.ty, .u: :UnOp {
tok.t == '++' ? :postinc : :postdec, exprdup(P.alloc, ex)
@@ -1882,10 +1878,6 @@ fn pexprefix(P *Parser) Expr {
if ex.ty.konst {
err(P, ex.loc, "left operand to prefix %qT operator is const", tok);
}
- if ex.u.#tag == :BitDot {
- err(P, ex.loc, "cannot apply pre-%srement operator to bitfield value",
- tok.t == '++' ? "inc" : "dec");
- }
return {
tok.loc, ex.ty, .u: :UnOp {
tok.t == '++' ? :preinc : :predec, exprdup(P.alloc, ex)
@@ -1916,6 +1908,9 @@ fn pexprefix(P *Parser) Expr {
and !(ex.u.#tag == :ZeroIni or ex.u.#tag == :AggIni or ex.u.#tag == :ArrIni) {
err(P, ex.loc, "invalid operand to `&': not an lvalue");
}
+ if ex.u.#tag == :BitDot {
+ err(P, ex.loc, "cannot take address of bitfield value");
+ }
return { tok.loc, ty2, .u: :UnOp { :addrof, exprdup(P.alloc, ex) }};
case lexmatch(P, &tok, :kw_as);
@@ -2142,8 +2137,6 @@ fn pexassign(P *Parser) Expr {
err(P, ex.loc,
"operands %t and %t to assignment operator %qT have incompatible types",
ex.ty, rhs.ty, tok);
- case okind != :Set and ex.u.#tag == :BitDot;
- err(P, ex.loc, "cannot apply compound assignment operator to bitfield value");
case ex.ty.konst;
err(P, ex.loc, "left operand to assignment is const");
}