File tree Expand file tree Collapse file tree 6 files changed +15
-21
lines changed
test/libcxx-03/atomics/atomics.types.operations/atomics.types.operations.req Expand file tree Collapse file tree 6 files changed +15
-21
lines changed Original file line number Diff line number Diff line change @@ -34,9 +34,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
3434
3535template <class _Tp >
3636struct atomic : public __atomic_base <_Tp> {
37- using __base = __atomic_base<_Tp>;
38- using value_type = _Tp;
39- using difference_type = value_type;
37+ using __base = __atomic_base<_Tp>;
4038
4139 _LIBCPP_HIDE_FROM_ABI atomic () _NOEXCEPT = default;
4240
@@ -59,8 +57,8 @@ struct atomic : public __atomic_base<_Tp> {
5957
6058template <class _Tp >
6159struct atomic <_Tp*> : public __atomic_base<_Tp*> {
62- using __base = __atomic_base<_Tp*>;
63- using value_type = _Tp*;
60+ using __base = __atomic_base<_Tp*>;
61+
6462 using difference_type = ptrdiff_t ;
6563
6664 _LIBCPP_HIDE_FROM_ABI atomic () _NOEXCEPT = default;
Original file line number Diff line number Diff line change @@ -32,6 +32,8 @@ struct __atomic_base // false
3232{
3333 mutable __cxx_atomic_impl<_Tp> __a_;
3434
35+ using value_type = _Tp;
36+
3537 _LIBCPP_HIDE_FROM_ABI bool is_lock_free () const volatile _NOEXCEPT {
3638 return __cxx_atomic_is_lock_free (sizeof (__cxx_atomic_impl<_Tp>));
3739 }
@@ -127,6 +129,8 @@ template <class _Tp>
127129struct __atomic_base <_Tp, true > : public __atomic_base<_Tp, false > {
128130 using __base = __atomic_base<_Tp, false >;
129131
132+ using difference_type = typename __base::value_type;
133+
130134 _LIBCPP_HIDE_FROM_ABI __atomic_base () _NOEXCEPT = default;
131135
132136 _LIBCPP_HIDE_FROM_ABI __atomic_base (_Tp __d) _NOEXCEPT : __base(__d) {}
Original file line number Diff line number Diff line change 66//
77// ===----------------------------------------------------------------------===//
88
9- // XFAIL: FROZEN-CXX03-HEADERS-FIXME
10-
119// <atomic>
1210
1311// template <class T>
@@ -48,12 +46,12 @@ void pointer_to_incomplete_type() {
4846void function_pointer () {
4947 {
5048 volatile std::atomic<void (*)(int )> fun;
51- // expected-error-re@*:* {{static assertion failed due to requirement '!is_function<void (int)>::value' {{.* }}Pointer to function isn't allowed}}
49+ // expected-error-re@*:* {{static assertion failed due to requirement {{.+ }}Pointer to function isn't allowed}}
5250 std::atomic_fetch_add (&fun, 0 );
5351 }
5452 {
5553 std::atomic<void (*)(int )> fun;
56- // expected-error-re@*:* {{static assertion failed due to requirement '!is_function<void (int)>::value' {{.* }}Pointer to function isn't allowed}}
54+ // expected-error-re@*:* {{static assertion failed due to requirement {{.+ }}Pointer to function isn't allowed}}
5755 std::atomic_fetch_add (&fun, 0 );
5856 }
5957}
Original file line number Diff line number Diff line change 66//
77// ===----------------------------------------------------------------------===//
88
9- // XFAIL: FROZEN-CXX03-HEADERS-FIXME
10-
119// <atomic>
1210
1311// template <class T>
@@ -51,12 +49,12 @@ void pointer_to_incomplete_type() {
5149void function_pointer () {
5250 {
5351 volatile std::atomic<void (*)(int )> fun;
54- // expected-error-re@*:* {{static assertion failed due to requirement '!is_function<void (int)>::value' {{.* }}Pointer to function isn't allowed}}
52+ // expected-error-re@*:* {{static assertion failed due to requirement {{.+ }}Pointer to function isn't allowed}}
5553 std::atomic_fetch_add_explicit (&fun, 0 , std::memory_order_relaxed);
5654 }
5755 {
5856 std::atomic<void (*)(int )> fun;
59- // expected-error-re@*:* {{static assertion failed due to requirement '!is_function<void (int)>::value' {{.* }}Pointer to function isn't allowed}}
57+ // expected-error-re@*:* {{static assertion failed due to requirement {{.+ }}Pointer to function isn't allowed}}
6058 std::atomic_fetch_add_explicit (&fun, 0 , std::memory_order_relaxed);
6159 }
6260}
Original file line number Diff line number Diff line change 66//
77// ===----------------------------------------------------------------------===//
88
9- // XFAIL: FROZEN-CXX03-HEADERS-FIXME
10-
119// <atomic>
1210
1311// template <class T>
@@ -48,12 +46,12 @@ void pointer_to_incomplete_type() {
4846void function_pointer () {
4947 {
5048 volatile std::atomic<void (*)(int )> fun;
51- // expected-error-re@*:* {{static assertion failed due to requirement '!is_function<void (int)>::value' {{.* }}Pointer to function isn't allowed}}
49+ // expected-error-re@*:* {{static assertion failed due to requirement {{.+ }}Pointer to function isn't allowed}}
5250 std::atomic_fetch_sub (&fun, 0 );
5351 }
5452 {
5553 std::atomic<void (*)(int )> fun;
56- // expected-error-re@*:* {{static assertion failed due to requirement '!is_function<void (int)>::value' {{.* }}Pointer to function isn't allowed}}
54+ // expected-error-re@*:* {{static assertion failed due to requirement {{.+ }}Pointer to function isn't allowed}}
5755 std::atomic_fetch_sub (&fun, 0 );
5856 }
5957}
Original file line number Diff line number Diff line change 66//
77// ===----------------------------------------------------------------------===//
88
9- // XFAIL: FROZEN-CXX03-HEADERS-FIXME
10-
119// <atomic>
1210
1311// template <class T>
@@ -51,12 +49,12 @@ void pointer_to_incomplete_type() {
5149void function_pointer () {
5250 {
5351 volatile std::atomic<void (*)(int )> fun;
54- // expected-error-re@*:* {{static assertion failed due to requirement '!is_function<void (int)>::value' {{.* }}Pointer to function isn't allowed}}
52+ // expected-error-re@*:* {{static assertion failed due to requirement {{.+ }}Pointer to function isn't allowed}}
5553 std::atomic_fetch_sub_explicit (&fun, 0 , std::memory_order_relaxed);
5654 }
5755 {
5856 std::atomic<void (*)(int )> fun;
59- // expected-error-re@*:* {{static assertion failed due to requirement '!is_function<void (int)>::value' {{.* }}Pointer to function isn't allowed}}
57+ // expected-error-re@*:* {{static assertion failed due to requirement {{.+ }}Pointer to function isn't allowed}}
6058 std::atomic_fetch_sub_explicit (&fun, 0 , std::memory_order_relaxed);
6159 }
6260}
You can’t perform that action at this time.
0 commit comments