Skip to content

Commit 54d1920

Browse files
committed
[libc++][atomic_ref] Fix cxx03 CI build
1 parent a132470 commit 54d1920

File tree

2 files changed

+9
-3
lines changed

2 files changed

+9
-3
lines changed

libcxx/include/__atomic/atomic_sync.h

+5-2
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,16 @@
1212
#include <__atomic/contention_t.h>
1313
#include <__atomic/cxx_atomic_impl.h>
1414
#include <__atomic/memory_order.h>
15+
#include <__atomic/to_gcc_order.h>
1516
#include <__availability>
1617
#include <__chrono/duration.h>
1718
#include <__config>
1819
#include <__memory/addressof.h>
1920
#include <__thread/poll_with_backoff.h>
2021
#include <__threading_support>
2122
#include <__type_traits/decay.h>
23+
#include <__type_traits/enable_if.h>
24+
#include <__type_traits/remove_cv.h>
2225
#include <cstring>
2326

2427
#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
@@ -35,8 +38,8 @@ struct __is_cxx_atomic_impl<__cxx_atomic_impl<_Tp> > : true_type {};
3538

3639
template <class _Tp>
3740
_LIBCPP_HIDE_FROM_ABI __enable_if_t<!__is_cxx_atomic_impl<__remove_cv_t<_Tp> >::value, _Tp>
38-
__cxx_atomic_load(_Tp* __ptr, memory_order __order) noexcept {
39-
alignas(_Tp) unsigned char __mem[sizeof(_Tp)];
41+
__cxx_atomic_load(_Tp* __ptr, memory_order __order) _NOEXCEPT {
42+
_ALIGNAS_TYPE(_Tp) unsigned char __mem[sizeof(_Tp)];
4043
auto* __ret = reinterpret_cast<_Tp*>(__mem);
4144
__atomic_load(__ptr, __ret, __to_gcc_order(__order));
4245
return *__ret;

libcxx/include/module.modulemap.in

+4-1
Original file line numberDiff line numberDiff line change
@@ -1096,7 +1096,10 @@ module std_private_atomic_atomic_flag [system] {
10961096
module std_private_atomic_atomic_init [system] { header "__atomic/atomic_init.h" }
10971097
module std_private_atomic_atomic_lock_free [system] { header "__atomic/atomic_lock_free.h" }
10981098
module std_private_atomic_atomic_ref [system] { header "__atomic/atomic_ref.h" }
1099-
module std_private_atomic_atomic_sync [system] { header "__atomic/atomic_sync.h" }
1099+
module std_private_atomic_atomic_sync [system] {
1100+
header "__atomic/atomic_sync.h"
1101+
export std_private_atomic_to_gcc_order
1102+
}
11001103
module std_private_atomic_check_memory_order [system] { header "__atomic/check_memory_order.h" }
11011104
module std_private_atomic_contention_t [system] { header "__atomic/contention_t.h" }
11021105
module std_private_atomic_cxx_atomic_impl [system] { header "__atomic/cxx_atomic_impl.h" }

0 commit comments

Comments
 (0)