[PATCH] D23343: [clang-tidy] modernize-make-{smart_ptr} private ctor bugfix

Piotr Padlewski via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 17 09:37:34 PDT 2016


Prazek added inline comments.

================
Comment at: clang-tidy/modernize/MakeSmartPtrCheck.cpp:32-33
@@ -31,1 +31,4 @@
 
+  // Calling make_smart_ptr from within a member function of a type with a
+  // private or protected constructor would be ill-formed.
+  auto CanCallCtor = unless(has(ignoringImpCasts(cxxConstructExpr(
----------------
alexfh wrote:
> malcolm.parsons wrote:
> > The private constructor could also be called from a friend class.
> It might only be relevant, if `std::make_(shared|unique)` is declared as a friend of the class in question, which is unlikely to be a common case and I don't think we need to focus on this now.
I am totally aware of it, but I never saw a friend delcaration for any class/function from libc++.


https://reviews.llvm.org/D23343





More information about the cfe-commits mailing list