diff --git a/libcxx/include/__atomic/aliases.h b/libcxx/include/__atomic/aliases.h --- a/libcxx/include/__atomic/aliases.h +++ b/libcxx/include/__atomic/aliases.h @@ -25,89 +25,90 @@ _LIBCPP_BEGIN_NAMESPACE_STD -typedef atomic atomic_bool; -typedef atomic atomic_char; -typedef atomic atomic_schar; -typedef atomic atomic_uchar; -typedef atomic atomic_short; -typedef atomic atomic_ushort; -typedef atomic atomic_int; -typedef atomic atomic_uint; -typedef atomic atomic_long; -typedef atomic atomic_ulong; -typedef atomic atomic_llong; -typedef atomic atomic_ullong; +using atomic_bool = atomic; +using atomic_char = atomic; +using atomic_schar = atomic; +using atomic_uchar = atomic; +using atomic_short = atomic; +using atomic_ushort = atomic; +using atomic_int = atomic; +using atomic_uint = atomic; +using atomic_long = atomic; +using atomic_ulong = atomic; +using atomic_llong = atomic; +using atomic_ullong = atomic; #ifndef _LIBCPP_HAS_NO_CHAR8_T -typedef atomic atomic_char8_t; +using atomic_char8_t = atomic; #endif -typedef atomic atomic_char16_t; -typedef atomic atomic_char32_t; +using atomic_char16_t = atomic; +using atomic_char32_t = atomic; #ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS -typedef atomic atomic_wchar_t; +using atomic_wchar_t = atomic; #endif -typedef atomic atomic_int_least8_t; -typedef atomic atomic_uint_least8_t; -typedef atomic atomic_int_least16_t; -typedef atomic atomic_uint_least16_t; -typedef atomic atomic_int_least32_t; -typedef atomic atomic_uint_least32_t; -typedef atomic atomic_int_least64_t; -typedef atomic atomic_uint_least64_t; +using atomic_int_least8_t = atomic; +using atomic_uint_least8_t = atomic; +using atomic_int_least16_t = atomic; +using atomic_uint_least16_t = atomic; +using atomic_int_least32_t = atomic; +using atomic_uint_least32_t = atomic; +using atomic_int_least64_t = atomic; +using atomic_uint_least64_t = atomic; -typedef atomic atomic_int_fast8_t; -typedef atomic atomic_uint_fast8_t; -typedef atomic atomic_int_fast16_t; -typedef atomic atomic_uint_fast16_t; -typedef atomic atomic_int_fast32_t; -typedef atomic atomic_uint_fast32_t; -typedef atomic atomic_int_fast64_t; -typedef atomic atomic_uint_fast64_t; +using atomic_int_fast8_t = atomic; +using atomic_uint_fast8_t = atomic; +using atomic_int_fast16_t = atomic; +using atomic_uint_fast16_t = atomic; +using atomic_int_fast32_t = atomic; +using atomic_uint_fast32_t = atomic; +using atomic_int_fast64_t = atomic; +using atomic_uint_fast64_t = atomic; -typedef atomic< int8_t> atomic_int8_t; -typedef atomic atomic_uint8_t; -typedef atomic< int16_t> atomic_int16_t; -typedef atomic atomic_uint16_t; -typedef atomic< int32_t> atomic_int32_t; -typedef atomic atomic_uint32_t; -typedef atomic< int64_t> atomic_int64_t; -typedef atomic atomic_uint64_t; +using atomic_int8_t = atomic< int8_t>; +using atomic_uint8_t = atomic; +using atomic_int16_t = atomic< int16_t>; +using atomic_uint16_t = atomic; +using atomic_int32_t = atomic< int32_t>; +using atomic_uint32_t = atomic; +using atomic_int64_t = atomic< int64_t>; +using atomic_uint64_t = atomic; -typedef atomic atomic_intptr_t; -typedef atomic atomic_uintptr_t; -typedef atomic atomic_size_t; -typedef atomic atomic_ptrdiff_t; -typedef atomic atomic_intmax_t; -typedef atomic atomic_uintmax_t; +using atomic_intptr_t = atomic; +using atomic_uintptr_t = atomic; +using atomic_size_t = atomic; +using atomic_ptrdiff_t = atomic; +using atomic_intmax_t = atomic; +using atomic_uintmax_t = atomic; // atomic_*_lock_free : prefer the contention type most highly, then the largest lock-free type #ifdef __cpp_lib_atomic_is_always_lock_free -# define _LIBCPP_CONTENTION_LOCK_FREE ::std::__libcpp_is_always_lock_free<__cxx_contention_t>::__value +# define _LIBCPP_CONTENTION_LOCK_FREE ::std::__libcpp_is_always_lock_free<__cxx_contention_t>::__value #else -# define _LIBCPP_CONTENTION_LOCK_FREE false +# define _LIBCPP_CONTENTION_LOCK_FREE false #endif #if ATOMIC_LLONG_LOCK_FREE == 2 -typedef __conditional_t<_LIBCPP_CONTENTION_LOCK_FREE, __cxx_contention_t, long long> __libcpp_signed_lock_free; -typedef __conditional_t<_LIBCPP_CONTENTION_LOCK_FREE, __cxx_contention_t, unsigned long long> __libcpp_unsigned_lock_free; +using __libcpp_signed_lock_free = __conditional_t<_LIBCPP_CONTENTION_LOCK_FREE, __cxx_contention_t, long long>; +using __libcpp_unsigned_lock_free = + __conditional_t<_LIBCPP_CONTENTION_LOCK_FREE, __cxx_contention_t, unsigned long long>; #elif ATOMIC_INT_LOCK_FREE == 2 -typedef __conditional_t<_LIBCPP_CONTENTION_LOCK_FREE, __cxx_contention_t, int> __libcpp_signed_lock_free; -typedef __conditional_t<_LIBCPP_CONTENTION_LOCK_FREE, __cxx_contention_t, unsigned int> __libcpp_unsigned_lock_free; +using __libcpp_signed_lock_free = __conditional_t<_LIBCPP_CONTENTION_LOCK_FREE, __cxx_contention_t, int>; +using __libcpp_unsigned_lock_free = __conditional_t<_LIBCPP_CONTENTION_LOCK_FREE, __cxx_contention_t, unsigned int>; #elif ATOMIC_SHORT_LOCK_FREE == 2 -typedef __conditional_t<_LIBCPP_CONTENTION_LOCK_FREE, __cxx_contention_t, short> __libcpp_signed_lock_free; -typedef __conditional_t<_LIBCPP_CONTENTION_LOCK_FREE, __cxx_contention_t, unsigned short> __libcpp_unsigned_lock_free; +using __libcpp_signed_lock_free = __conditional_t<_LIBCPP_CONTENTION_LOCK_FREE, __cxx_contention_t, short>; +using __libcpp_unsigned_lock_free = __conditional_t<_LIBCPP_CONTENTION_LOCK_FREE, __cxx_contention_t, unsigned short>; #elif ATOMIC_CHAR_LOCK_FREE == 2 -typedef __conditional_t<_LIBCPP_CONTENTION_LOCK_FREE, __cxx_contention_t, char> __libcpp_signed_lock_free; -typedef __conditional_t<_LIBCPP_CONTENTION_LOCK_FREE, __cxx_contention_t, unsigned char> __libcpp_unsigned_lock_free; +using __libcpp_signed_lock_free = __conditional_t<_LIBCPP_CONTENTION_LOCK_FREE, __cxx_contention_t, char>; +using __libcpp_unsigned_lock_free = __conditional_t<_LIBCPP_CONTENTION_LOCK_FREE, __cxx_contention_t, unsigned char>; #else - // No signed/unsigned lock-free types -#define _LIBCPP_NO_LOCK_FREE_TYPES +// No signed/unsigned lock-free types +# define _LIBCPP_NO_LOCK_FREE_TYPES #endif #if !defined(_LIBCPP_NO_LOCK_FREE_TYPES) -typedef atomic<__libcpp_signed_lock_free> atomic_signed_lock_free; -typedef atomic<__libcpp_unsigned_lock_free> atomic_unsigned_lock_free; +using atomic_signed_lock_free = atomic<__libcpp_signed_lock_free>; +using atomic_unsigned_lock_free = atomic<__libcpp_unsigned_lock_free>; #endif _LIBCPP_END_NAMESPACE_STD diff --git a/libcxx/include/__atomic/atomic.h b/libcxx/include/__atomic/atomic.h --- a/libcxx/include/__atomic/atomic.h +++ b/libcxx/include/__atomic/atomic.h @@ -29,9 +29,9 @@ struct atomic : public __atomic_base<_Tp> { - typedef __atomic_base<_Tp> __base; - typedef _Tp value_type; - typedef value_type difference_type; + using __base = __atomic_base<_Tp>; + using value_type = _Tp; + using difference_type = value_type; #if _LIBCPP_STD_VER >= 20 _LIBCPP_HIDE_FROM_ABI @@ -61,9 +61,9 @@ struct atomic<_Tp*> : public __atomic_base<_Tp*> { - typedef __atomic_base<_Tp*> __base; - typedef _Tp* value_type; - typedef ptrdiff_t difference_type; + using __base = __atomic_base<_Tp*>; + using value_type = _Tp*; + using difference_type = ptrdiff_t; _LIBCPP_HIDE_FROM_ABI atomic() _NOEXCEPT = default; diff --git a/libcxx/include/__atomic/atomic_base.h b/libcxx/include/__atomic/atomic_base.h --- a/libcxx/include/__atomic/atomic_base.h +++ b/libcxx/include/__atomic/atomic_base.h @@ -143,7 +143,7 @@ struct __atomic_base<_Tp, true> : public __atomic_base<_Tp, false> { - typedef __atomic_base<_Tp, false> __base; + using __base = __atomic_base<_Tp, false>; _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 __atomic_base() _NOEXCEPT = default; diff --git a/libcxx/include/__atomic/atomic_flag.h b/libcxx/include/__atomic/atomic_flag.h --- a/libcxx/include/__atomic/atomic_flag.h +++ b/libcxx/include/__atomic/atomic_flag.h @@ -24,7 +24,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD -typedef struct atomic_flag +struct atomic_flag { __cxx_atomic_impl<_LIBCPP_ATOMIC_FLAG_TYPE> __a_; @@ -82,8 +82,7 @@ atomic_flag& operator=(const atomic_flag&) = delete; atomic_flag& operator=(const atomic_flag&) volatile = delete; -} atomic_flag; - +}; inline _LIBCPP_HIDE_FROM_ABI bool diff --git a/libcxx/include/__atomic/memory_order.h b/libcxx/include/__atomic/memory_order.h --- a/libcxx/include/__atomic/memory_order.h +++ b/libcxx/include/__atomic/memory_order.h @@ -31,7 +31,7 @@ __mo_seq_cst }; -typedef underlying_type<__legacy_memory_order>::type __memory_order_underlying_t; +using __memory_order_underlying_t = underlying_type<__legacy_memory_order>::type; #if _LIBCPP_STD_VER >= 20 @@ -56,14 +56,14 @@ #else -typedef enum memory_order { +enum memory_order { memory_order_relaxed = __mo_relaxed, memory_order_consume = __mo_consume, memory_order_acquire = __mo_acquire, memory_order_release = __mo_release, memory_order_acq_rel = __mo_acq_rel, memory_order_seq_cst = __mo_seq_cst, -} memory_order; +}; #endif // _LIBCPP_STD_VER >= 20 diff --git a/libcxx/utils/data/ignore_format.txt b/libcxx/utils/data/ignore_format.txt --- a/libcxx/utils/data/ignore_format.txt +++ b/libcxx/utils/data/ignore_format.txt @@ -213,7 +213,6 @@ libcxx/include/any libcxx/include/array libcxx/include/atomic -libcxx/include/__atomic/aliases.h libcxx/include/__atomic/atomic_base.h libcxx/include/__atomic/atomic_flag.h libcxx/include/__atomic/atomic.h