Skip to content

Commit 0561ede

Browse files
authored
[libc++][jthread] LWG3788: jthread::operator=(jthread&&) postconditions are unimplementable under self-assignment (llvm#153758)
Already implemented in LLVM18: [695138c](llvm@695138c) For details see: llvm#105045 (comment) Closes llvm#105045
1 parent 76d993b commit 0561ede

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

libcxx/docs/Status/Cxx23Issues.csv

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@
230230
"`LWG3782 <https://wg21.link/LWG3782>`__","Should ``<math.h>`` declare ``::lerp``?","2022-11 (Kona)","|Complete|","17",""
231231
"`LWG3784 <https://wg21.link/LWG3784>`__","std.compat should not provide ``::byte`` and its friends","2022-11 (Kona)","|Complete|","19",""
232232
"`LWG3785 <https://wg21.link/LWG3785>`__","``ranges::to`` is over-constrained on the destination type being a range","2022-11 (Kona)","","",""
233-
"`LWG3788 <https://wg21.link/LWG3788>`__","``jthread::operator=(jthread&&)`` postconditions are unimplementable under self-assignment","2022-11 (Kona)","","",""
233+
"`LWG3788 <https://wg21.link/LWG3788>`__","``jthread::operator=(jthread&&)`` postconditions are unimplementable under self-assignment","2022-11 (Kona)","|Complete|","18",""
234234
"`LWG3792 <https://wg21.link/LWG3792>`__","``__cpp_lib_constexpr_algorithms`` should also be defined in ``<utility>``","2022-11 (Kona)","|Complete|","16",""
235235
"`LWG3795 <https://wg21.link/LWG3795>`__","Self-move-assignment of ``std::future`` and ``std::shared_future`` have unimplementable postconditions","2022-11 (Kona)","","",""
236236
"`LWG3796 <https://wg21.link/LWG3796>`__","``movable-box`` as member should use ``default-initialization`` instead of ``copy-initialization``","2022-11 (Kona)","","",""

libcxx/test/std/thread/thread.jthread/assign.move.pass.cpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -112,5 +112,14 @@ int main(int, char**) {
112112
assert(j1.get_id() == j2Id);
113113
}
114114

115+
// LWG3788: self-assignement
116+
{
117+
std::jthread j = support::make_test_jthread([] {});
118+
auto oldId = j.get_id();
119+
j = std::move(j);
120+
121+
assert(j.get_id() == oldId);
122+
}
123+
115124
return 0;
116125
}

0 commit comments

Comments
 (0)