Instead of destroying the object with allocator::destroy, we must
call its destructor directly. As a fly-by also mark LWG3008 as
fixed since it is handled by our implementation.
This was pointed out by Tim Song in https://reviews.llvm.org/D140913.
Paths
| Differential D143791
[libc++] Fix bug in allocate_shared_for_overwrite ClosedPublic Authored by ldionne on Feb 10 2023, 3:44 PM.
Details
Summary Instead of destroying the object with allocator::destroy, we must This was pointed out by Tim Song in https://reviews.llvm.org/D140913.
Diff Detail
Event TimelineComment Actions The intent would be to cherry-pick to LLVM 16 since this is effectively a bugfix. Thanks a lot @tcanens for bringing this to our attention.
Comment Actions Test failures are unrelated and have been fixed on main. @tcanens I'll ship this now because I think it is correct and I want to cherry-pick onto release/16.x ASAP, but I'll be happy to get your review even post-commit, as always. This revision is now accepted and ready to land.Feb 13 2023, 5:50 AM This revision was landed with ongoing or failed builds.Feb 13 2023, 5:51 AM Closed by commit rG580109025801: [libc++] Fix bug in allocate_shared_for_overwrite (authored by ldionne). · Explain Why This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 496621 libcxx/docs/Status/Cxx20Issues.csv
libcxx/include/__memory/construct_at.h
libcxx/include/__memory/shared_ptr.h
libcxx/test/std/utilities/memory/util.smartptr/util.smartptr.shared/util.smartptr.shared.create/allocate_shared_for_overwrite.pass.cpp
libcxx/test/support/test_allocator.h
|