diff --git a/src/aro/Parser.zig b/src/aro/Parser.zig index ac3ceef5..7ac783c6 100644 --- a/src/aro/Parser.zig +++ b/src/aro/Parser.zig @@ -6415,6 +6415,8 @@ fn lorExpr(p: *Parser) Error!Result { if (try lhs.adjustTypes(tok, &rhs, p, .boolean_logic)) { const res = lhs.val.toBool(p.comp) or rhs.val.toBool(p.comp); lhs.val = Value.fromBool(res); + } else { + lhs.val.boolCast(p.comp); } try lhs.boolRes(p, .bool_or_expr, rhs); } diff --git a/test/cases/float values.c b/test/cases/float values.c index 3d16702c..d349c79d 100644 --- a/test/cases/float values.c +++ b/test/cases/float values.c @@ -1,2 +1,6 @@ _Static_assert(-1.0 - 1.0 == -2.0, ""); _Static_assert(-2.0f == -2.0, ""); +_Static_assert(1.0 == (2.0||0), ""); +void foo(void) { + float f = 2.0 || 0; +}