We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents c0819f9 + b58eb6f commit bdda3c3Copy full SHA for bdda3c3
src/util/simplify_expr.cpp
@@ -570,6 +570,17 @@ bool simplify_exprt::simplify_typecast(exprt &expr)
570
expr=from_integer(int_value, expr_type);
571
return false;
572
}
573
+ else if(expr_type_id == ID_c_enum_tag)
574
+ {
575
+ const auto &c_enum_type = ns.follow_tag(to_c_enum_tag_type(expr_type));
576
+ if(!c_enum_type.is_incomplete()) // possibly incomplete
577
578
+ exprt tmp = from_integer(int_value, c_enum_type);
579
+ tmp.type() = expr_type; // we maintain the tag type
580
+ expr = tmp;
581
+ return false;
582
+ }
583
584
585
else if(op_type_id==ID_rational)
586
{
0 commit comments