[libcxx-commits] [PATCH] D70117: [libc++][P0174] Deprecated/removed parts of default allocator.

Michael Park via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Thu Feb 13 05:31:24 PST 2020


mpark marked 8 inline comments as done.
mpark added inline comments.


================
Comment at: libcxx/include/memory:1361
 __has_allocate_hint_test(_Alloc&& __a, _SizeType&& __sz, _ConstVoidPtr&& __p)
+    _LIBCPP_SUPPRESS_DEPRECATED_PUSH
     -> decltype((void)__a.allocate(__sz, __p), true_type());
----------------
ldionne wrote:
> What! I didn't know you could surround literally any piece of code with these pragmas! It does make sense though, since it's a preprocessor thing. Clang will really take the pragma into account when parsing just that part of the declaration?
I believe so!


================
Comment at: libcxx/include/memory:1394
+    _LIBCPP_SUPPRESS_DEPRECATED_PUSH
+    -> decltype(__a.construct(__p, _VSTD::forward<_Args>(__args)...), true_type());
+    _LIBCPP_SUPPRESS_DEPRECATED_POP
----------------
ldionne wrote:
> If the return type of `__a.construct(...)` somehow hijacks `operator,`, this won't work. But I don't care, don't change it.
> 
> An Allocator's `construct` method is supposed to return `void` -- if someone's that clever, they deserve to be taught better.
+1


================
Comment at: libcxx/test/libcxx/depr/depr.default.allocator/allocator.members/address.depr_in_cxx17.fail.cpp:15-16
 
-#include <memory>
-#include <cassert>
 
----------------
ldionne wrote:
> Wait, you shouldn't get rid of this test pre-C++17. You should mark it as `REQUIRES: c++03, ..., c++14`. Or did I miss something and you did not actually remove this test?
This test has been moved to `libcxx/test/libcxx/depr/depr.default.allocator/allocator.members/address.cxx2a.pass.cpp`, following the pattern for `auto_ptr` which have `auto_ptr.cxx1z.pass.cpp` and `auto_ptr.depr_in_cxx11.fail.cpp`.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D70117/new/

https://reviews.llvm.org/D70117





More information about the libcxx-commits mailing list