[PATCH] D26138: [clang-tidy] Add modernize-use-equals-delete check

Aaron Ballman via cfe-commits cfe-commits at lists.llvm.org
Wed Nov 2 09:30:38 PDT 2016


aaron.ballman added a comment.

Can you split the modernize-use-default changes into a separate patch? I think that change requires additional discussion, because renaming the check may break users relying on the old name. The changes aren't really related (aside from naming consistency), and I'd rather not let modernize-use-default discussion delay accepting this patch.



================
Comment at: clang-tidy/modernize/UseEqualsDeleteCheck.cpp:58
+      << FixItHint::CreateInsertion(StartLoc, "public: ")
+      << FixItHint::CreateInsertion(AfterLoc, " private:");
+}
----------------
I am on the fence about this fixit. On the one hand, the fix is a technical improvement because it means that implementations will consistently find the declaration and bark about it being explicitly deleted. On the other hand, the fixit suggests code that should never pass a reasonable code review.

I'm wondering if it would make more sense to leave the access specifiers alone and just put a FIXME in the code to point the situation out. I am guessing that at some point we will have a refactoring tool that can help without resorting to making declarations like `public: C() = delete; private:`.

What do you think?


https://reviews.llvm.org/D26138





More information about the cfe-commits mailing list