Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions libcxx/include/__atomic/atomic.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ struct __atomic_base // false
{
mutable __cxx_atomic_impl<_Tp> __a_;

using value_type = _Tp;

#if _LIBCPP_STD_VER >= 17
static constexpr bool is_always_lock_free = __libcpp_is_always_lock_free<__cxx_atomic_impl<_Tp> >::__value;
#endif
Expand Down Expand Up @@ -145,6 +147,8 @@ template <class _Tp>
struct __atomic_base<_Tp, true> : public __atomic_base<_Tp, false> {
using __base _LIBCPP_NODEBUG = __atomic_base<_Tp, false>;

using difference_type = typename __base::value_type;

_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 __atomic_base() _NOEXCEPT = default;

_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR __atomic_base(_Tp __d) _NOEXCEPT : __base(__d) {}
Expand Down Expand Up @@ -229,8 +233,6 @@ struct __atomic_waitable_traits<__atomic_base<_Tp, _IsIntegral> > {
template <class _Tp>
struct atomic : public __atomic_base<_Tp> {
using __base _LIBCPP_NODEBUG = __atomic_base<_Tp>;
using value_type = _Tp;
using difference_type = value_type;

#if _LIBCPP_STD_VER >= 20
_LIBCPP_HIDE_FROM_ABI atomic() = default;
Expand Down Expand Up @@ -258,8 +260,8 @@ struct atomic : public __atomic_base<_Tp> {
template <class _Tp>
struct atomic<_Tp*> : public __atomic_base<_Tp*> {
using __base _LIBCPP_NODEBUG = __atomic_base<_Tp*>;
using value_type = _Tp*;
using difference_type = ptrdiff_t;

using difference_type = ptrdiff_t;

_LIBCPP_HIDE_FROM_ABI atomic() _NOEXCEPT = default;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
//
//===----------------------------------------------------------------------===//

// XFAIL: FROZEN-CXX03-HEADERS-FIXME

// <atomic>

// template <class T>
Expand Down Expand Up @@ -63,12 +65,12 @@ struct S {
void member_function_pointer() {
{
volatile std::atomic<void (S::*)(int)> fun;
// expected-error@*:* {{no member named 'fetch_add' in}}
// expected-error@*:* {{no matching function for call to 'atomic_fetch_add'}}
std::atomic_fetch_add(&fun, 0);
}
{
std::atomic<void (S::*)(int)> fun;
// expected-error@*:* {{no member named 'fetch_add' in}}
// expected-error@*:* {{no matching function for call to 'atomic_fetch_add'}}
std::atomic_fetch_add(&fun, 0);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
//
//===----------------------------------------------------------------------===//

// XFAIL: FROZEN-CXX03-HEADERS-FIXME

// <atomic>

// template <class T>
Expand Down Expand Up @@ -66,12 +68,12 @@ struct S {
void member_function_pointer() {
{
volatile std::atomic<void (S::*)(int)> fun;
// expected-error@*:* {{no member named 'fetch_add' in}}
// expected-error@*:* {{no matching function for call to 'atomic_fetch_add_explicit'}}
std::atomic_fetch_add_explicit(&fun, 0, std::memory_order_relaxed);
}
{
std::atomic<void (S::*)(int)> fun;
// expected-error@*:* {{no member named 'fetch_add' in}}
// expected-error@*:* {{no matching function for call to 'atomic_fetch_add_explicit'}}
std::atomic_fetch_add_explicit(&fun, 0, std::memory_order_relaxed);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
//
//===----------------------------------------------------------------------===//

// XFAIL: FROZEN-CXX03-HEADERS-FIXME

// <atomic>

// template <class T>
Expand Down Expand Up @@ -63,12 +65,12 @@ struct S {
void member_function_pointer() {
{
volatile std::atomic<void (S::*)(int)> fun;
// expected-error@*:* {{no member named 'fetch_sub' in}}
// expected-error@*:* {{no matching function for call to 'atomic_fetch_sub'}}
std::atomic_fetch_sub(&fun, 0);
}
{
std::atomic<void (S::*)(int)> fun;
// expected-error@*:* {{no member named 'fetch_sub' in}}
// expected-error@*:* {{no matching function for call to 'atomic_fetch_sub'}}
std::atomic_fetch_sub(&fun, 0);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
//
//===----------------------------------------------------------------------===//

// XFAIL: FROZEN-CXX03-HEADERS-FIXME

// <atomic>

// template <class T>
Expand Down Expand Up @@ -66,12 +68,12 @@ struct S {
void member_function_pointer() {
{
volatile std::atomic<void (S::*)(int)> fun;
// expected-error@*:* {{no member named 'fetch_sub' in}}
// expected-error@*:* {{no matching function for call to 'atomic_fetch_sub_explicit'}}
std::atomic_fetch_sub_explicit(&fun, 0, std::memory_order_relaxed);
}
{
std::atomic<void (S::*)(int)> fun;
// expected-error@*:* {{no member named 'fetch_sub' in}}
// expected-error@*:* {{no matching function for call to 'atomic_fetch_sub_explicit'}}
std::atomic_fetch_sub_explicit(&fun, 0, std::memory_order_relaxed);
}
}
Loading