[libcxx-commits] [libcxx] [libc++] cv-qualified types in atomic and atomic_ref (P3323R1) (PR #121414)

A. Jiang via libcxx-commits libcxx-commits at lists.llvm.org
Sun Jul 20 09:59:05 PDT 2025


================
@@ -112,6 +114,9 @@ _LIBCPP_BEGIN_NAMESPACE_STD
 
 template <typename _Tp, typename _Base = __cxx_atomic_base_impl<_Tp> >
 struct __cxx_atomic_impl : public _Base {
+  static_assert(!is_const<_Tp>::value && !is_volatile<_Tp>::value,
+                "std::atomic<T> requires that 'T' be a cv-unqualified type");
----------------
frederick-vs-ja wrote:

I think we should move the `static_assert` into `__check_atomic_mandates`, like #131754.

https://github.com/llvm/llvm-project/pull/121414


More information about the libcxx-commits mailing list