[PATCH] D117359: [scudo] Make Scudo compile for C++20

Kostya Kortchinsky via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jan 14 13:52:34 PST 2022


cryptoad created this revision.
cryptoad added reviewers: hctim, cferris, mcgrathr, schottm.
cryptoad requested review of this revision.
Herald added a project: Sanitizers.
Herald added a subscriber: Sanitizers.

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.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D117359

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


Index: compiler-rt/lib/scudo/standalone/tests/mutex_test.cpp
===================================================================
--- compiler-rt/lib/scudo/standalone/tests/mutex_test.cpp
+++ compiler-rt/lib/scudo/standalone/tests/mutex_test.cpp
@@ -43,7 +43,7 @@
   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);
     }
   }


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D117359.400140.patch
Type: text/x-patch
Size: 477 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220114/4f51e89a/attachment.bin>


More information about the llvm-commits mailing list