@@ -510,12 +510,12 @@ namespace gh153782 {
510510
511511namespace mutually_exclusive_test_case_1 {
512512struct StorageWrapper {
513- // Imagine those two call a reset() function (among other things)
513+ // Imagine the destructor and copy constructor both call a reset() function (among other things).
514514 ~StorageWrapper () { delete parts; }
515515 StorageWrapper (StorageWrapper const &) = default ;
516516
517- // Mind that there is no assignment here -- this is the bug we would like to find.
518- void operator =(StorageWrapper&&) { delete parts; } // newdelete-warning{{Attempt to release already released memory}}
517+ // Mind that there is no `parts = other.parts` assignment -- this is the bug we would like to find.
518+ void operator =(StorageWrapper&& other ) { delete parts; } // newdelete-warning{{Attempt to release already released memory}}
519519
520520 // Not provided, typically would do `parts = new long`.
521521 StorageWrapper ();
@@ -531,12 +531,12 @@ void test_non_trivial_struct_assignment() {
531531
532532namespace mutually_exclusive_test_case_2 {
533533struct StorageWrapper {
534- // Imagine those two call a reset() function (among other things)
534+ // Imagine the destructor and copy constructor both call a reset() function (among other things).
535535 ~StorageWrapper () { delete parts; }
536536 StorageWrapper (StorageWrapper const &) = default ;
537537
538- // Mind that there is no assignment here -- this is the bug we would like to find.
539- void operator =(StorageWrapper&&) { delete parts; }
538+ // Mind that there is no `parts = other.parts` assignment -- this is the bug we would like to find.
539+ void operator =(StorageWrapper&& other ) { delete parts; }
540540
541541 // Not provided, typically would do `parts = new long`.
542542 StorageWrapper ();
@@ -552,12 +552,12 @@ void test_non_trivial_struct_assignment() {
552552
553553namespace mutually_exclusive_test_case_3 {
554554struct StorageWrapper {
555- // Imagine those two call a reset() function (among other things)
555+ // Imagine the destructor and copy constructor both call a reset() function (among other things).
556556 ~StorageWrapper () { delete parts; }
557557 StorageWrapper (StorageWrapper const &) = default ;
558558
559- // Mind that there is no assignment here -- this is the bug we would like to find.
560- void operator =(StorageWrapper&&) { delete parts; } // newdelete-warning{{Attempt to release already released memory}}
559+ // Mind that there is no `parts = other.parts` assignment -- this is the bug we would like to find.
560+ void operator =(StorageWrapper&& other ) { delete parts; } // newdelete-warning{{Attempt to release already released memory}}
561561
562562 // Not provided, typically would do `parts = new long`.
563563 StorageWrapper ();
0 commit comments