[PATCH] D30610: [clang-tidy] Added options to cppcoreguidelines-special-member-functions check

Aaron Ballman via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Nov 24 07:19:05 PST 2017


aaron.ballman added a comment.

In https://reviews.llvm.org/D30610#934452, @malcolm.parsons wrote:

> I'd like an `AllowDeletedCopyFunctions` option that allows move and destructor functions to be missing when copying is disabled.
>
>   struct A {
>     A(const A&) = delete;
>     A& operator=(const A&) = delete;
>   }
>   


Doesn't `AllowMissingMoveFunctions` do almost that? If not, it should -- that code produces a class that does not declare a move constructor or move assignment operator per [class.copy]p8 and [class.copy.assign]p4, so that would be a "missing move function". Granted, that doesn't handle the dtor case, but I think an `AllowMissingDestructor` option might be overkill -- the destructor isn't missing, it's implicitly declared as defaulted in that case, but if the C++ Core Guidelines folks want it spelled out explicitly then, it might be worth the option. Have they weighed in on your exception?


https://reviews.llvm.org/D30610





More information about the cfe-commits mailing list