Skip to content

Commit 636a1cf

Browse files
author
Kostya Kortchinsky
committed
[scudo] Make Scudo compile for C++20
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
1 parent ac4202f commit 636a1cf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

compiler-rt/lib/scudo/standalone/tests/mutex_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class TestData {
4343
void backoff() {
4444
volatile T LocalData[Size] = {};
4545
for (scudo::u32 I = 0; I < Size; I++) {
46-
LocalData[I]++;
46+
LocalData[I] = LocalData[I] + 1;
4747
EXPECT_EQ(LocalData[I], 1U);
4848
}
4949
}

0 commit comments

Comments
 (0)