diff --git a/xml/issue4172.xml b/xml/issue4172.xml index 68ebbacf82..b9dcf670d9 100644 --- a/xml/issue4172.xml +++ b/xml/issue4172.xml @@ -3,7 +3,7 @@ unique_lock self-move-assignment is broken -
+
Casey Carter 13 Nov 2024 99 @@ -28,6 +28,11 @@ from self-move-assignment as of LWG .

Also, the move assignment operator doesn't specify what it returns.

+ +2024-11-18; Casey expands the PR to cover `shared_lock` +

+`shared_lock` has the same problems, and can be fixed in the same way. +

@@ -99,6 +104,33 @@ In this case, *this will own the mutex after the assignment and u will not.

+ +
  • +

    +Modify as follows: +

    + +
    +
    
    +shared_lock& operator=(shared_lock&& sl) noexcept;
    +
    +

    +-17- Effects: +If `owns` calls `pm->unlock_shared()`. +Equivalent to: `shared_lock{std::move(sl)}.swap(*this)`. +

    +

    +-?- Returns: `*this`. +

    +

    +-18- Postconditions: +`pm == sl_p.pm` and `owns == sl_p.owns` +(where `sl_p` is the state of `sl` just prior to this assignment), +`sl.pm == nullptr` and `sl.owns == false`. + +

    +
    +