Skip to content

Commit 95f6505

Browse files
NathanJPhillipssmowton
authored andcommitted
Comment on types for which expr_dynamic_cast is not implemented
1 parent d35710f commit 95f6505

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

src/util/std_expr.h

+6-9
Original file line numberDiff line numberDiff line change
@@ -2638,10 +2638,9 @@ inline shift_exprt &to_shift_expr(exprt &expr)
26382638
return static_cast<shift_exprt &>(expr);
26392639
}
26402640

2641-
// template<> inline bool check_expr_type<shift_exprt>(const exprt &base)
2642-
// {
2643-
// return true;
2644-
// }
2641+
// The to_*_expr function for this type doesn't do any checks before casting,
2642+
// therefore the implementation is essentially a static_cast.
2643+
// Enabling expr_dynamic_cast would hide this; instead use static_cast directly.
26452644
// inline void validate_expr(const shift_exprt &value)
26462645
// {
26472646
// validate_operands(value, 2, "Shifts must have two operands");
@@ -4223,11 +4222,9 @@ inline ieee_float_op_exprt &to_ieee_float_op_expr(exprt &expr)
42234222
return static_cast<ieee_float_op_exprt &>(expr);
42244223
}
42254224

4226-
// template<>
4227-
// inline bool check_expr_type<ieee_float_op_exprt>(const exprt &base)
4228-
// {
4229-
// return true;
4230-
// }
4225+
// The to_*_expr function for this type doesn't do any checks before casting,
4226+
// therefore the implementation is essentially a static_cast.
4227+
// Enabling expr_dynamic_cast would hide this; instead use static_cast directly.
42314228
// template<>
42324229
// inline void validate_expr<ieee_float_op_exprt>(
42334230
// const ieee_float_op_exprt &value)

0 commit comments

Comments
 (0)