[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.
Loading
Please sign in to comment