Skip to content

LWG2593: Moved-from state of Allocators #100220

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
cjdb opened this issue Jul 23, 2024 · 2 comments · Fixed by #107344
Closed

LWG2593: Moved-from state of Allocators #100220

cjdb opened this issue Jul 23, 2024 · 2 comments · Fixed by #107344
Labels
c++20 libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. lwg-issue this is an issue that was filed to the Library Working Group

Comments

@cjdb
Copy link
Contributor

cjdb commented Jul 23, 2024

Link: https://wg21.link/lwg2593

@cjdb cjdb added libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. c++20 lwg-issue this is an issue that was filed to the Library Working Group labels Jul 23, 2024
@llvmbot
Copy link
Member

llvmbot commented Jul 23, 2024

@llvm/issue-subscribers-c-20

Author: Christopher Di Bella (cjdb)

@ldionne ldionne changed the title Apply 'LWG2593 Moved-from state of Allocators' LWG2593: Moved-from state of Allocators Aug 1, 2024
@frederick-vs-ja
Copy link
Contributor

frederick-vs-ja commented Aug 2, 2024

Possibly nothing to do. I'm not aware of libc++ (or any other standard library implementation) even provided such a weird allocator type which did't meet the strengthened requirement.

But the test_allocator in the test suits needs to be fixed.

TEST_CONSTEXPR_CXX14 test_allocator(test_allocator&& a) TEST_NOEXCEPT : data_(a.data_), id_(a.id_), stats_(a.stats_) {
if (stats_ != nullptr) {
++stats_->count;
++stats_->moved;
}
assert(a.data_ != test_alloc_base::destructed_value && a.id_ != test_alloc_base::destructed_value &&
"moving from destroyed allocator");
a.data_ = test_alloc_base::moved_value;
a.id_ = test_alloc_base::moved_value;
}

ldionne pushed a commit that referenced this issue Sep 10, 2024
The resolution of LWG2593 didn't require the standard library
implementation to change. It merely strengthened requirements on
user-defined allocator types and allowed the implementation to make
stronger assumptions. The status is tentatively set to Nothing To Do.

However, `test_allocator` in libc++'s test suit needs to be fixed to
conform to the strengthened requirements.

Closes #100220.
@ldionne ldionne moved this from Done to Nothing To Do in libc++ Standards Conformance Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++20 libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. lwg-issue this is an issue that was filed to the Library Working Group
Projects
Status: Nothing To Do
Development

Successfully merging a pull request may close this issue.

3 participants