Hi!
I was implementing a SA checker when I ran into the next (problem?) :
Whenever I write a callback PostCall/PreCall with the next body:
{
if (dyn_cast(&Call))
llvm::errs() << “DtorCall\n”;
if (dyn_cast(Call.getDecl()))
llvm::errs() << “DtorDecl\n”;
return;
}
Then I could not find a case where the cast to CXXDestructorCall is successful.
Running this simple “checker” on the below example emitted no output to errs:
class A {
};
int main()
{
A a;
{
A b;
}
}
However if change the inner block this way:
{
A b;
b.~A();
}
then “DtorDecl” is displayed which makes sense.
The detailed description of the CXXDestructorCall says:
Represents an implicit call to a C++ destructor.
This can occur at the end of a scope (for automatic objects), at the end of a full-expression (for temporaries), or as part of a delete.
My question is: Does “can” mean in this context that the callback is quite unreliable even in trivial cases or is it a bug and the destructor call should trigger?
Thanks,
Peter