[libcxx-commits] [libcxx] [libc++] cv-qualified types in atomic and atomic_ref (P3323R1) (PR #121414)
Louis Dionne via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Mar 31 12:52:02 PDT 2025
================
@@ -45,12 +45,12 @@ template <class T, class StoreOp, class LoadOp>
void test_seq_cst(StoreOp store_op, LoadOp load_op) {
#ifndef TEST_HAS_NO_THREADS
for (int i = 0; i < 100; ++i) {
- T old_value(make_value<T>(0));
- T new_value(make_value<T>(1));
+ T old_value(make_value<std::remove_cv_t<T>>(0));
+ T new_value(make_value<std::remove_cv_t<T>>(1));
- T copy_x = old_value;
+ T copy_x = const_cast<std::remove_cv_t<T> const&>(old_value);
----------------
ldionne wrote:
I don't understand why this needs a `const_cast`, can you explain?
https://github.com/llvm/llvm-project/pull/121414
More information about the libcxx-commits
mailing list