gcc/analyzer/ChangeLog:
PR analyzer/97489
* engine.cc (exploded_graph::add_function_entry): Assert that we
have a function body.
(exploded_graph::on_escaped_function): Reject fndecls that don't
have a function body.
gcc/testsuite/ChangeLog:
PR analyzer/97489
* g++.dg/analyzer/pr97489.C: New test.
exploded_node *
exploded_graph::add_function_entry (function *fun)
{
+ gcc_assert (gimple_has_body_p (fun->decl));
+
/* Be idempotent. */
if (m_functions_with_enodes.contains (fun))
{
if (!fun)
return;
+ if (!gimple_has_body_p (fndecl))
+ return;
+
exploded_node *enode = add_function_entry (fun);
if (logger)
{
--- /dev/null
+struct X {
+ virtual ~X() {}
+ virtual void key_function();
+};
+
+void X::key_function() {}