Skip to content

Commit

Permalink
[scudo] Make Scudo compile for C++20
Browse files Browse the repository at this point in the history
In C++20 compound assignment to volatile (here `LocalData[I]++`) is
deprecated, so `mutex_test.cpp` fails to compile.

Simply changing it to `LocalData[I] = LocalData[I] + 1` fixes it.

Differential Revision: https://reviews.llvm.org/D117359
  • Loading branch information
Kostya Kortchinsky authored and bsdjhb committed Jan 3, 2023
1 parent a14078c commit f6265d1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/scudo/standalone/tests/mutex_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class TestData {
void backoff() {
volatile T LocalData[Size] = {};
for (scudo::u32 I = 0; I < Size; I++) {
LocalData[I]++;
LocalData[I] = LocalData[I] + 1;
EXPECT_EQ(LocalData[I], 1U);
}
}
Expand Down

0 comments on commit f6265d1

Please sign in to comment.