Skip to content

Commit e78e7d1

Browse files
author
Daniel Kroening
committed
compound assignments require usual arithmetic promotions
The C frontend needs to apply the usual arithmetic promotion rules in compound assignments. Fixes #3706.
1 parent 748bb00 commit e78e7d1

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

regression/cbmc/compound-assignment/compound_promotion.desc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
KNOWNBUG
2-
compound_promition.c
1+
CORE
2+
compound_promotion.c
33

44
^EXIT=0$
55
^SIGNAL=0$

src/ansi-c/c_typecheck_expr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3459,7 +3459,7 @@ void c_typecheck_baset::typecheck_side_effect_assignment(
34593459
}
34603460
else
34613461
{
3462-
implicit_typecast(op1, o_type0);
3462+
implicit_typecast_arithmetic(op0, op1);
34633463

34643464
if(is_number(op1.type()) ||
34653465
op1.type().id()==ID_bool ||

0 commit comments

Comments
 (0)