diff --git a/src/goto-programs/goto_function.h b/src/goto-programs/goto_function.h index 2db5fe04e17..c84d68b869c 100644 --- a/src/goto-programs/goto_function.h +++ b/src/goto-programs/goto_function.h @@ -46,7 +46,7 @@ class goto_functiont type.set(ID_C_hide, true); } - goto_functiont() + goto_functiont() : body(), type({}, empty_typet()) { } diff --git a/src/goto-programs/goto_model.h b/src/goto-programs/goto_model.h index f4a3d62cb8e..80c14205968 100644 --- a/src/goto-programs/goto_model.h +++ b/src/goto-programs/goto_model.h @@ -92,7 +92,8 @@ class goto_modelt : public abstract_goto_modelt bool can_produce_function(const irep_idt &id) const override { - return goto_functions.function_map.count(id); + return goto_functions.function_map.find(id) != + goto_functions.function_map.end(); } }; @@ -127,7 +128,8 @@ class wrapper_goto_modelt : public abstract_goto_modelt bool can_produce_function(const irep_idt &id) const override { - return goto_functions.function_map.count(id); + return goto_functions.function_map.find(id) != + goto_functions.function_map.end(); } private: diff --git a/src/util/arith_tools.h b/src/util/arith_tools.h index 54f8ed60fb8..21e615c0c74 100644 --- a/src/util/arith_tools.h +++ b/src/util/arith_tools.h @@ -10,14 +10,13 @@ Author: Daniel Kroening, kroening@kroening.com #ifndef CPROVER_UTIL_ARITH_TOOLS_H #define CPROVER_UTIL_ARITH_TOOLS_H +#include "invariant.h" #include "mp_arith.h" #include "optional.h" -#include "invariant.h" +#include "std_expr.h" #include "deprecate.h" -class exprt; -class constant_exprt; class typet; // this one will go away @@ -27,8 +26,6 @@ DEPRECATED("Use the constant_exprt version instead") bool to_integer(const exprt &expr, mp_integer &int_value); // returns 'true' on error -/// \deprecated: use numeric_cast instead -DEPRECATED("Use numeric_cast instead") bool to_integer(const constant_exprt &expr, mp_integer &int_value); // returns 'true' on error @@ -49,7 +46,7 @@ struct numeric_castt final optionalt operator()(const exprt &expr) const { mp_integer out; - if(to_integer(expr, out)) + if(expr.id() != ID_constant || to_integer(to_constant_expr(expr), out)) return {}; return out; }