EricWF added a comment.

This patch seems to support constructing a `shared_ptr<FuncType>` without 
providing a non-default deleter. I don't think this should work because the 
default deleter will attempt to free a function pointer, which is never valid. 
(Although I think this case will still cause a compile error).



================
Comment at: include/memory:3896
+
+template <class _Tp> struct __shared_ptr_default_allocator<_Tp, false>
+{
----------------
I would just handle this case with the primary template rather than a complete 
specialization.


================
Comment at: include/memory:3903
+{
+    typedef allocator<int> type;
+};
----------------
Using an arbitrary and unrelated allocator type `std::allocator<int>` still 
makes me nervous. I would rather use a custom allocator type written only for 
this use case.


https://reviews.llvm.org/D30837



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to