diff --git a/libcxx/include/__algorithm/in_in_out_result.h b/libcxx/include/__algorithm/in_in_out_result.h --- a/libcxx/include/__algorithm/in_in_out_result.h +++ b/libcxx/include/__algorithm/in_in_out_result.h @@ -26,9 +26,9 @@ 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 --- a/libcxx/include/__algorithm/in_in_result.h +++ b/libcxx/include/__algorithm/in_in_result.h @@ -26,8 +26,8 @@ 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 --- a/libcxx/include/__algorithm/in_out_out_result.h +++ b/libcxx/include/__algorithm/in_out_out_result.h @@ -25,9 +25,9 @@ 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 --- a/libcxx/include/__algorithm/in_out_result.h +++ b/libcxx/include/__algorithm/in_out_result.h @@ -26,8 +26,8 @@ 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 --- a/libcxx/include/__ranges/copyable_box.h +++ b/libcxx/include/__ranges/copyable_box.h @@ -41,7 +41,7 @@ // 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 @@ 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 --- a/libcxx/include/__ranges/drop_view.h +++ b/libcxx/include/__ranges/drop_view.h @@ -45,7 +45,7 @@ // 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 --- a/libcxx/include/__ranges/join_view.h +++ b/libcxx/include/__ranges/join_view.h @@ -67,7 +67,7 @@ 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 --- a/libcxx/include/__ranges/reverse_view.h +++ b/libcxx/include/__ranges/reverse_view.h @@ -43,8 +43,8 @@ // 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 --- a/libcxx/include/__ranges/subrange.h +++ b/libcxx/include/__ranges/subrange.h @@ -82,9 +82,9 @@ 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 --- a/libcxx/include/__ranges/take_view.h +++ b/libcxx/include/__ranges/take_view.h @@ -39,7 +39,7 @@ 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 @@ 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 --- a/libcxx/include/__ranges/transform_view.h +++ b/libcxx/include/__ranges/transform_view.h @@ -61,8 +61,8 @@ 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