[PATCH] D59307: Patch llvm bug 41033 concerning atomicity of statement expressions

Melanie Blower via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 13 13:43:19 PDT 2019


mibintc added a comment.

In D59307#1427644 <https://reviews.llvm.org/D59307#1427644>, @jfb wrote:

> I think you also want to test C++ `std::atomic` ...


The bug described in https://bugs.llvm.org/show_bug.cgi?id=41033 doesn't occur using C++ atomic, I rewrote the test case this way, and it compiles without error.  The "load" operation returns int since all the atomic operations occur under the covers using builtins.   Does this convey the test you have in mind?

#include <atomic>
int fum(int y) {

  std::atomic<int> x(1);
  y = ({x.load();});

}


Repository:
  rC Clang

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59307/new/

https://reviews.llvm.org/D59307





More information about the cfe-commits mailing list