I’d say you’d want to delete all declarations of A::A() (and as such, look for all constructor declarations), and then use isThisDeclarationADefinition() to figure out whether there’s a body to delete, too…
Um, in some cases I think this will do to me, but what I want in this case is a bit different because I need to look for non-trivial default constructors. Thus, I’ll need to check this condition in the definition and then, if that default constructor has somenthing in the definition, delete its declaration too. Any other suggestion?
I'd say you'd want to delete all declarations of A::A() (and as such, look
for all constructor declarations), and then use
isThisDeclarationADefinition() to figure out whether there's a body to
delete, too...
Um, in some cases I think this will do to me, but what I want in this case
is a bit different because I need to look for *non-trivial* default
constructors. Thus, I'll need to check this condition in the definition and
then, if that default constructor has somenthing in the definition, delete
its declaration too. Any other suggestion?
If you are sure that all declarations of the constructor will be visible
where it is implemented, you can match for the non-trivial default
constructor, and then go backwards to all the decls you see from that TU.
If this is not true in your case (which in this example shouldn't happen, I
think), you can always output:
a) for all destructors, all declarations / definitions
b) for all non-trivial destructors, the fact that they're non-trivial
Then you merge this information in a post-processing step. Things like this
are quite common, which is why we've put together a MapReduce pipeline to
support that kind of operation at a large scale, but for smaller code bases
you can do something with a simple text format.
We're currently also working on finding out how to upstream something that
would support such a workflow better...