[compiler-rt] 636a1cf - [scudo] Make Scudo compile for C++20

Kostya Kortchinsky via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 14 14:53:51 PST 2022


Author: Kostya Kortchinsky
Date: 2022-01-14T14:53:40-08:00
New Revision: 636a1cfdcdb8af750a33a6dd2c5d6f84a59aa1c3

URL: https://github.com/llvm/llvm-project/commit/636a1cfdcdb8af750a33a6dd2c5d6f84a59aa1c3
DIFF: https://github.com/llvm/llvm-project/commit/636a1cfdcdb8af750a33a6dd2c5d6f84a59aa1c3.diff

LOG: [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

Added: 
    

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

Removed: 
    


################################################################################
diff  --git a/compiler-rt/lib/scudo/standalone/tests/mutex_test.cpp b/compiler-rt/lib/scudo/standalone/tests/mutex_test.cpp
index efee6fea22678..d3242a3f57d46 100644
--- a/compiler-rt/lib/scudo/standalone/tests/mutex_test.cpp
+++ b/compiler-rt/lib/scudo/standalone/tests/mutex_test.cpp
@@ -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);
     }
   }


        


More information about the llvm-commits mailing list