Skip to content
Unverified Commit 7cbf9598 authored by Stephan T. Lavavej's avatar Stephan T. Lavavej Committed by GitHub
Browse files

[libc++][test] Avoid using `allocator<const T>` (#73545)

Found while running libc++'s test suite with MSVC's STL.

MSVC's STL rejects `allocator<const T>`. This may or may not be
justified by the current Standardese (it was bogus in the C++03 era),
but it's how we reject usage like `vector<const T>`.

A bunch of `mdspan` tests are failing for us because some centralized
machinery is using `allocator<const T>`. Testing that `mdspan` and its
associated types work properly with `const T` is good and necessary, but
directly allocating `const T` is what's a problem for MSVC's STL. I'd
like to ask for a very targeted change here that preserves all of the
test coverage but changes how `ElementPool` interacts with `allocator`.

This intentionally leaves `ElementPool::get_ptr()` returning `T*`
(pointer-to-possibly-const), so there's no externally visible
difference.
parent 67268da6
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment