Skip to content

Commit 904f919

Browse files
[NFC] Clarify comments in test
1 parent dbd3caa commit 904f919

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

clang/test/Analysis/NewDelete-checker-test.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -510,12 +510,12 @@ namespace gh153782 {
510510

511511
namespace mutually_exclusive_test_case_1 {
512512
struct 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

532532
namespace mutually_exclusive_test_case_2 {
533533
struct 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

553553
namespace mutually_exclusive_test_case_3 {
554554
struct 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

Comments
 (0)