[libcxx] Fix allocator<void>::pointer in C++20 with removed members
When compiled with `-D_LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_MEMBERS` uses of `allocator<void>::pointer` resulted in compiler errors after D104323. If we instantiate the primary template, `allocator<void>::reference` produces an error 'cannot form references to void'. To workaround this, allow to bring back the `allocator<void>` specialization by defining the new `_LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_VOID_SPECIALIZATION` macro. To make sure the code that uses `allocator<void>` and the removed members does not break, both `_LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_MEMBERS` and `_LIBCPP_ENABLE_CXX20_REMOVED_ALLOCATOR_MEMBERS` have to be defined. Reviewed By: ldionne, #libc, philnik Differential Revision: https://reviews.llvm.org/D126210
Loading
Please sign in to comment