[all-commits] [llvm/llvm-project] 51ba98: [libc++][test] Fix `size_type` issues with `MinSeq...

A. Jiang via All-commits all-commits at lists.llvm.org
Fri Feb 7 17:27:20 PST 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 51ba9819b40e04ef0ddbe141d3d30c32a295a0bc
      https://github.com/llvm/llvm-project/commit/51ba9819b40e04ef0ddbe141d3d30c32a295a0bc
  Author: A. Jiang <de34 at live.cn>
  Date:   2025-02-08 (Sat, 08 Feb 2025)

  Changed paths:
    M libcxx/test/support/MinSequenceContainer.h
    M libcxx/test/support/min_allocator.h

  Log Message:
  -----------
  [libc++][test] Fix `size_type` issues with `MinSequenceContainer` and `min_allocator` (#126267)

`MinSequenceContainer::size` can be narrowing on 64-bit platforms, and
MSVC complains about such implicit conversion. This PR changes the
implicit conversion to explicit `static_cast`.

`min_allocator::allocate` and `min_allocator::deallocate` have
`ptrdiff_t` as the parameter type, which seems weird, because the
underlying `std::allocator`'s member functions take `size_t`. It seems
better to use `size_t` consistently.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list