File tree Expand file tree Collapse file tree 3 files changed +30
-0
lines changed
regression/ansi-c/undeclared_function Expand file tree Collapse file tree 3 files changed +30
-0
lines changed Original file line number Diff line number Diff line change 1+ CORE
2+ uninterpreted.c
3+
4+ missing type information required to construct call to uninterpreted function
5+ ^EXIT=70$
6+ ^SIGNAL=0$
7+ --
8+ ^warning: ignoring
9+ ^Invariant check failed$
10+ --
11+ Test to confirm that an actionable error message is provided.
Original file line number Diff line number Diff line change 1+ #include <assert.h>
2+
3+ int main ()
4+ {
5+ int x ;
6+ assert (__CPROVER_uninterpreted_fn (x ) == __CPROVER_uninterpreted_fn (x ));
7+ return 0 ;
8+ }
9+
10+ int __CPROVER_uninterpreted_fn (int x );
Original file line number Diff line number Diff line change @@ -892,6 +892,15 @@ void goto_convertt::do_function_call_symbol(
892892 if (lhs.is_nil ())
893893 return ;
894894
895+ if (function.type ().get_bool (ID_C_incomplete))
896+ {
897+ error ().source_location = function.find_source_location ();
898+ error () << " '" << identifier << " ' is not declared, "
899+ << " missing type information required to construct call to "
900+ << " uninterpreted function" << eom;
901+ throw 0 ;
902+ }
903+
895904 const code_typet &function_call_type = to_code_type (function.type ());
896905 mathematical_function_typet::domaint domain;
897906 for (const auto ¶meter : function_call_type.parameters ())
You can’t perform that action at this time.
0 commit comments