diff options
author | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2024-04-12 09:52:06 +0200 |
---|---|---|
committer | fanquake <fanquake@gmail.com> | 2024-04-17 14:05:09 +0100 |
commit | 364bf01ff254f9fa01e14f24002af682a51b4883 (patch) | |
tree | 3905d34bc67acfbd82c3d969b93e95e0670c09fa | |
parent | 9277793b4ee70a6f0d471cf3ff3051f2eebdbb15 (diff) |
build: Fix false positive `CHECK_ATOMIC` test for clang-15
Github-Pull: #29859
Rebased-From: dd3e0fa12534c9e782dc9c24d2e30b70a0d73176
-rw-r--r-- | build-aux/m4/l_atomic.m4 | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/build-aux/m4/l_atomic.m4 b/build-aux/m4/l_atomic.m4 index aa00168fce..859ddaabbb 100644 --- a/build-aux/m4/l_atomic.m4 +++ b/build-aux/m4/l_atomic.m4 @@ -7,7 +7,7 @@ dnl warranty. # Clang, when building for 32-bit, # and linking against libstdc++, requires linking with # -latomic if using the C++ atomic library. -# Can be tested with: clang++ test.cpp -m32 +# Can be tested with: clang++ -std=c++20 test.cpp -m32 # # Sourced from http://bugs.debian.org/797228 @@ -27,8 +27,11 @@ m4_define([_CHECK_ATOMIC_testbody], [[ auto t1 = t.load(); t.compare_exchange_strong(t1, 3s); - std::atomic<int64_t> a{}; + std::atomic<double> d{}; + d.store(3.14); + auto d1 = d.load(); + std::atomic<int64_t> a{}; int64_t v = 5; int64_t r = a.fetch_add(v); return static_cast<int>(r); |