Skip to content

Commit feb59ab

Browse files
committed
Use not-as-deprecated version of to_integer
1 parent e23a1bb commit feb59ab

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/util/arith_tools.h

+3-4
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,13 @@ Author: Daniel Kroening, [email protected]
1010
#ifndef CPROVER_UTIL_ARITH_TOOLS_H
1111
#define CPROVER_UTIL_ARITH_TOOLS_H
1212

13+
#include "invariant.h"
1314
#include "mp_arith.h"
1415
#include "optional.h"
15-
#include "invariant.h"
16+
#include "std_expr.h"
1617

1718
#include "deprecate.h"
1819

19-
class exprt;
20-
class constant_exprt;
2120
class typet;
2221

2322
// this one will go away
@@ -49,7 +48,7 @@ struct numeric_castt<mp_integer> final
4948
optionalt<mp_integer> operator()(const exprt &expr) const
5049
{
5150
mp_integer out;
52-
if(to_integer(expr, out))
51+
if(expr.id() != ID_constant || to_integer(to_constant_expr(expr), out))
5352
return {};
5453
return out;
5554
}

0 commit comments

Comments
 (0)