Hi,
thinking a bit of the problem, I guess we could match in addition to
DECL_CONTEXT the whole inline stack of both statements and see if there
are inlined new/delete operators and if so if they are always in
matching pairs.
The inline stack is available as
for (tree block = gimple_block (call); block && TREE_CODE (block) == BLOCK;
block = BLOCK_SUPERCONTEXT (block))
{
tree fn = block_ultimate_origin (block);
if (fn != NULL && TREE_CODE (fn) == FUNCTION_DECL)
do the checking htere.
}
But I do not understand what C++ promises here and in what conditions
the new/delete pair can be removed.
Honza