Skip to content

Commit dcbee5b

Browse files
committed
Prefer not is_const and not is_volatile when checking cv-unqualified
1 parent 0b96b4c commit dcbee5b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

libcxx/include/__atomic/support.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@
1010
#define _LIBCPP___ATOMIC_SUPPORT_H
1111

1212
#include <__config>
13-
#include <__type_traits/is_same.h>
13+
#include <__type_traits/is_const.h>
1414
#include <__type_traits/is_trivially_copyable.h>
15-
#include <__type_traits/remove_cv.h>
15+
#include <__type_traits/is_volatile.h>
1616

1717
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
1818
# pragma GCC system_header
@@ -116,7 +116,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
116116
template <typename _Tp, typename _Base = __cxx_atomic_base_impl<_Tp> >
117117
struct __cxx_atomic_impl : public _Base {
118118
static_assert(is_trivially_copyable<_Tp>::value, "std::atomic<T> requires that 'T' be a trivially copyable type");
119-
static_assert(is_same<_Tp, typename remove_cv<_Tp>::type>::value,
119+
static_assert(!is_const<_Tp>::value && !is_volatile<_Tp>::value,
120120
"std::atomic<T> requires that 'T' be a cv-unqualified type");
121121

122122
_LIBCPP_HIDE_FROM_ABI __cxx_atomic_impl() _NOEXCEPT = default;

0 commit comments

Comments
 (0)