[libcxx-commits] [PATCH] D132081: [libc++] Remove __deque_base

Brooks Moses via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Sep 6 10:54:40 PDT 2022


brooksmoses added a comment.

I'm seeing new compilation errors from the moved allocator `static_assert` in this patch.

Reduced test case:

  #include <deque>
  #include <memory>
  BaseContainerTtemplate <typename T> struct CustomAllocator : public std::allocator<T> {};
  void foo() {std::deque<int, CustomAllocator<int>> bar;}

Error:

  include/c++/v1/deque:974:3: error: static assertion failed due to requirement 'is_same<CustomAllocator<int>, std::allocator<int>>::value': rebinding an allocator to value_type should result in the original allocator
    static_assert(is_same<allocator_type, typename __rebind_alloc_helper<__alloc_traits, value_type>::type>::value,
    ^             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  test.cc:4:51: note: in instantiation of template class 'std::deque<int, CustomAllocator<int>>' requested here
  void foo() {std::deque<int, CustomAllocator<int>> bar;}
                                                    ^

Could you please investigate?


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D132081



More information about the libcxx-commits mailing list