[PATCH] D18264: [clang-tidy] misc-assign-operator-signature checker checks return value of all assign operators

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 21 07:26:01 PDT 2016


aaron.ballman added a comment.

In http://reviews.llvm.org/D18264#379159, @xazax.hun wrote:

> In http://reviews.llvm.org/D18264#379092, @aaron.ballman wrote:
>
> > Also, it's quite common for older code (pre C++11) to return void and make these functions private (with no definition) as an early form of deleting the operator.
>
>
> This checker will not warn on private methods.


Good deal.

> About EDSLs, I think they are not the common case. In case it is important, it might make sense to make this configurable, but I think the minority of the C++ projects have EDSLs so it make more sense to warn on those cases by default. What do you think?


That's why I am wondering about how much this increases the false positive rate. I don't think DSLs are going to be a huge problem, but if it turns out they are, then a configuration option makes sense. If we don't see a large increase, then no need to waste the effort on an option.

Also, this appears to be changing the behavior of the cppcoreguidelines-c-copy-assignment-signature alias. If the core guidelines don't prohibit this behavior under that rule, we should not trigger the diagnostic if the user enabled the check via cppcoreguidelines-c-copy-assignment-signature instead of misc-assign-operator-signature. Check out MoveConstructorInitCheck as an example of how we have handled this before.


http://reviews.llvm.org/D18264





More information about the cfe-commits mailing list