[PATCH] D54745: [clang-tidy] Don't generate incorrect fixes for class with deleted copy constructor in smart_ptr check.

Jonas Toth via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Nov 20 02:38:44 PST 2018


JonasToth added a comment.

Does make_unique require the copy constructor if it could move?
And would the same argument apply to the move-constructors as the arguments are forwarded?
What would happen in the obscure case of a public copy-constructor, but private move-constructor (not saying it makes sense :))



================
Comment at: clang-tidy/modernize/MakeSmartPtrCheck.cpp:380
+      // The fix (std::make_unique) requires to see the copy constructor of
+      // Pair, so we don't generate fix if the copy consturctor is not visible
+      // or deleted.
----------------
typo: s/consturctor/constructor/


================
Comment at: test/clang-tidy/modernize-make-unique.cpp:35
 
+struct NoCopyCtor {
+  NoCopyCtor(const NoCopyCtor&) = delete;
----------------
please add a case for the `private` copy-constructor as well.


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D54745





More information about the cfe-commits mailing list