diff --git a/libcxx/include/__algorithm/in_in_out_result.h b/libcxx/include/__algorithm/in_in_out_result.h index d020b918ac73..3a163d1a75b6 100644 --- a/libcxx/include/__algorithm/in_in_out_result.h +++ b/libcxx/include/__algorithm/in_in_out_result.h @@ -26,9 +26,9 @@ namespace ranges { template struct in_in_out_result { - [[no_unique_address]] _I1 in1; - [[no_unique_address]] _I2 in2; - [[no_unique_address]] _O1 out; + _LIBCPP_NO_UNIQUE_ADDRESS _I1 in1; + _LIBCPP_NO_UNIQUE_ADDRESS _I2 in2; + _LIBCPP_NO_UNIQUE_ADDRESS _O1 out; template requires convertible_to && convertible_to && convertible_to diff --git a/libcxx/include/__algorithm/in_in_result.h b/libcxx/include/__algorithm/in_in_result.h index e2585a709c1c..159092189a53 100644 --- a/libcxx/include/__algorithm/in_in_result.h +++ b/libcxx/include/__algorithm/in_in_result.h @@ -26,8 +26,8 @@ namespace ranges { template struct in_in_result { - [[no_unique_address]] _I1 in1; - [[no_unique_address]] _I2 in2; + _LIBCPP_NO_UNIQUE_ADDRESS _I1 in1; + _LIBCPP_NO_UNIQUE_ADDRESS _I2 in2; template requires convertible_to && convertible_to diff --git a/libcxx/include/__algorithm/in_out_out_result.h b/libcxx/include/__algorithm/in_out_out_result.h index e97a89147378..9788fbfa2e74 100644 --- a/libcxx/include/__algorithm/in_out_out_result.h +++ b/libcxx/include/__algorithm/in_out_out_result.h @@ -25,9 +25,9 @@ _LIBCPP_BEGIN_NAMESPACE_STD namespace ranges { template struct in_out_out_result { - [[no_unique_address]] _I1 in; - [[no_unique_address]] _O1 out1; - [[no_unique_address]] _O2 out2; + _LIBCPP_NO_UNIQUE_ADDRESS _I1 in; + _LIBCPP_NO_UNIQUE_ADDRESS _O1 out1; + _LIBCPP_NO_UNIQUE_ADDRESS _O2 out2; template requires convertible_to && convertible_to && convertible_to diff --git a/libcxx/include/__algorithm/in_out_result.h b/libcxx/include/__algorithm/in_out_result.h index cdd6ab48fbd2..124b4d6ffb6c 100644 --- a/libcxx/include/__algorithm/in_out_result.h +++ b/libcxx/include/__algorithm/in_out_result.h @@ -26,8 +26,8 @@ namespace ranges { template struct in_out_result { - [[no_unique_address]] _InputIterator in; - [[no_unique_address]] _OutputIterator out; + _LIBCPP_NO_UNIQUE_ADDRESS _InputIterator in; + _LIBCPP_NO_UNIQUE_ADDRESS _OutputIterator out; template requires convertible_to && convertible_to { public: - [[no_unique_address]] _Iter __current_ = _Iter(); + _LIBCPP_NO_UNIQUE_ADDRESS _Iter __current_ = _Iter(); iter_difference_t<_Iter> __count_ = 0; using iterator_type = _Iter; diff --git a/libcxx/include/__ranges/copyable_box.h b/libcxx/include/__ranges/copyable_box.h index 8d43b8884565..d092b7f9ba29 100644 --- a/libcxx/include/__ranges/copyable_box.h +++ b/libcxx/include/__ranges/copyable_box.h @@ -41,7 +41,7 @@ namespace ranges { // Primary template - uses std::optional and introduces an empty state in case assignment fails. template<__copy_constructible_object _Tp> class __copyable_box { - [[no_unique_address]] optional<_Tp> __val_; + _LIBCPP_NO_UNIQUE_ADDRESS optional<_Tp> __val_; public: template @@ -116,7 +116,7 @@ namespace ranges { template<__copy_constructible_object _Tp> requires __doesnt_need_empty_state_for_copy<_Tp> && __doesnt_need_empty_state_for_move<_Tp> class __copyable_box<_Tp> { - [[no_unique_address]] _Tp __val_; + _LIBCPP_NO_UNIQUE_ADDRESS _Tp __val_; public: template diff --git a/libcxx/include/__ranges/drop_view.h b/libcxx/include/__ranges/drop_view.h index f3701bc71130..64c567416453 100644 --- a/libcxx/include/__ranges/drop_view.h +++ b/libcxx/include/__ranges/drop_view.h @@ -45,7 +45,7 @@ namespace ranges { // one can't call begin() on it more than once. static constexpr bool _UseCache = forward_range<_View> && !(random_access_range<_View> && sized_range<_View>); using _Cache = _If<_UseCache, __non_propagating_cache>, __empty_cache>; - [[no_unique_address]] _Cache __cached_begin_ = _Cache(); + _LIBCPP_NO_UNIQUE_ADDRESS _Cache __cached_begin_ = _Cache(); range_difference_t<_View> __count_ = 0; _View __base_ = _View(); diff --git a/libcxx/include/__ranges/join_view.h b/libcxx/include/__ranges/join_view.h index 1472924bdb80..1af22213369a 100644 --- a/libcxx/include/__ranges/join_view.h +++ b/libcxx/include/__ranges/join_view.h @@ -67,7 +67,7 @@ namespace ranges { static constexpr bool _UseCache = !is_reference_v<_InnerRange>; using _Cache = _If<_UseCache, __non_propagating_cache>, __empty_cache>; - [[no_unique_address]] _Cache __cache_; + _LIBCPP_NO_UNIQUE_ADDRESS _Cache __cache_; _View __base_ = _View(); // TODO: [[no_unique_address]] makes clang crash! File a bug :) public: diff --git a/libcxx/include/__ranges/reverse_view.h b/libcxx/include/__ranges/reverse_view.h index 4da16133088f..c7f1ab8f943b 100644 --- a/libcxx/include/__ranges/reverse_view.h +++ b/libcxx/include/__ranges/reverse_view.h @@ -43,8 +43,8 @@ namespace ranges { // amortized O(1) begin() method. static constexpr bool _UseCache = !random_access_range<_View> && !common_range<_View>; using _Cache = _If<_UseCache, __non_propagating_cache>>, __empty_cache>; - [[no_unique_address]] _Cache __cached_begin_ = _Cache(); - [[no_unique_address]] _View __base_ = _View(); + _LIBCPP_NO_UNIQUE_ADDRESS _Cache __cached_begin_ = _Cache(); + _LIBCPP_NO_UNIQUE_ADDRESS _View __base_ = _View(); public: _LIBCPP_HIDE_FROM_ABI diff --git a/libcxx/include/__ranges/subrange.h b/libcxx/include/__ranges/subrange.h index 0ea9d7887590..2450e230f281 100644 --- a/libcxx/include/__ranges/subrange.h +++ b/libcxx/include/__ranges/subrange.h @@ -82,9 +82,9 @@ namespace ranges { static constexpr bool _MustProvideSizeAtConstruction = !_StoreSize; // just to improve compiler diagnostics struct _Empty { constexpr _Empty(auto) noexcept { } }; using _Size = conditional_t<_StoreSize, make_unsigned_t>, _Empty>; - [[no_unique_address]] _Iter __begin_ = _Iter(); - [[no_unique_address]] _Sent __end_ = _Sent(); - [[no_unique_address]] _Size __size_ = 0; + _LIBCPP_NO_UNIQUE_ADDRESS _Iter __begin_ = _Iter(); + _LIBCPP_NO_UNIQUE_ADDRESS _Sent __end_ = _Sent(); + _LIBCPP_NO_UNIQUE_ADDRESS _Size __size_ = 0; public: _LIBCPP_HIDE_FROM_ABI diff --git a/libcxx/include/__ranges/take_view.h b/libcxx/include/__ranges/take_view.h index 5f8fbaa0bd8b..de44fc1fae72 100644 --- a/libcxx/include/__ranges/take_view.h +++ b/libcxx/include/__ranges/take_view.h @@ -39,7 +39,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD namespace ranges { template class take_view : public view_interface> { - [[no_unique_address]] _View __base_ = _View(); + _LIBCPP_NO_UNIQUE_ADDRESS _View __base_ = _View(); range_difference_t<_View> __count_ = 0; template class __sentinel; @@ -136,7 +136,7 @@ namespace ranges { using _Base = __maybe_const<_Const, _View>; template using _Iter = counted_iterator>>; - [[no_unique_address]] sentinel_t<_Base> __end_ = sentinel_t<_Base>(); + _LIBCPP_NO_UNIQUE_ADDRESS sentinel_t<_Base> __end_ = sentinel_t<_Base>(); template friend class take_view<_View>::__sentinel; diff --git a/libcxx/include/__ranges/transform_view.h b/libcxx/include/__ranges/transform_view.h index a8d2ea3f0ed2..dad46536c75f 100644 --- a/libcxx/include/__ranges/transform_view.h +++ b/libcxx/include/__ranges/transform_view.h @@ -61,8 +61,8 @@ class transform_view : public view_interface> { template class __iterator; template class __sentinel; - [[no_unique_address]] __copyable_box<_Fn> __func_; - [[no_unique_address]] _View __base_ = _View(); + _LIBCPP_NO_UNIQUE_ADDRESS __copyable_box<_Fn> __func_; + _LIBCPP_NO_UNIQUE_ADDRESS _View __base_ = _View(); public: _LIBCPP_HIDE_FROM_ABI