diff options
author | 2024-04-12 00:36:46 -0700 | |
---|---|---|
committer | 2024-04-16 19:33:03 +0000 | |
commit | 1f8f41b219eed63ed3532c25cd11efaa692b8478 (patch) | |
tree | 595d6bcd8433b55e592d41538a5efa0ebd7923d4 /compiler/linker/linker_patch.h | |
parent | 5ab729974f972b0a0a3ddbc70f30742a69c6d612 (diff) |
Avoid calling Alloc::{address,construct,destroy}
The std::allocator<T> class deprecates these three methods in C++17 and
removes them in C++20. Replace the address method with the
std::addressof free function. Replace construct and destroy with calls
to std::allocator_traits<allocator_type>::{construct,destroy}, which
calls the method on the allocator if it exists, but otherwise does the
expected thing.
Specifically, the std::allocator_traits functions use placement-new
and an explicit destructor call before C++20, and they use
std::{construct_at,destroy_at} in C++20 and up.
This CL fixes about ~1000 deprecation warnings that happen after
upgrading libc++.
Bug: 311052584
Bug: 333165689
Test: atest art_standalone_libartbase_tests
Test: atest art_standalone_runtime_tests
Test: apply topic:use-prebuilt-libcxx and build Android
Change-Id: Ia981d84882ef15a9c06772d5a9fcbfbc812b8c5c
Diffstat (limited to 'compiler/linker/linker_patch.h')
0 files changed, 0 insertions, 0 deletions