the check will now warn when the user provided definitions of this functions is equivalent to the explicitly defaulted ones.
Details
Diff Detail
Event Timeline
Generally, I feel like a lot of the code would be written better as ast matchers (by adding new matchers if necessary). You can use tooling::ast_matchers::matches if you want to do a match inside a callback.
clang-tidy/modernize/UseDefaultCheck.cpp | ||
---|---|---|
278–279 | FIXME: Put into ASTMatchers.h (or just do that :) |
OK, thanks! I will try to refactor some of the parts into AST matchers
then. It will probably take some time, though.
Refactor most of the code to use AST matchers.
Note that now this change requires D14152 to be applied first.
In which cases can this be false? (I assume if not all are copied?)
This can be false is there is we do anything else than initializing the
bases and members. So the previous code is there to ensure that we do that
and this is here to ensure that we *only* do that.
Cool, those cases would be useful to have as comment, for example:
Make sure there are no additional initializations going on (for example, of indirect bases)
and that all fields and direct bases have been initialized.
Put more logic into the matchers.
Btw, do you know how can I get the exception specification of a function?
This looks like something we'd want to matcherify, too.