D'oh! I must admit that I only glanced at the
manual this time.
You are absolutely correct; Lint should be able to
see that the constructor takes custody of "this"
with the option you had originally. It's an
interesting situation though, because in the case of:
Obj* child = new Obj( &pa );
...Lint needs to be aware that a function (the
constructor) will take custody of an object that
has not yet been created.
It seems there is a work-around though -- assuming
that, in your actual production code, you intend
to call some member function of Obj (with the
"child" pointer) within the function where that
object is created, e.g.:
child->Print(); // Obj::Print must be called in
the same scope as "new Obj" for this to work.
If that's the case, then you can just do:
//lint -sem(Obj::Print, custodial(t))
...which should work.
In any event, we do plan to support your first
custodial semantic in a future version of Lint.
Thanks for the feedback!