diff --git a/libcxx/include/__algorithm/find_end.h b/libcxx/include/__algorithm/find_end.h --- a/libcxx/include/__algorithm/find_end.h +++ b/libcxx/include/__algorithm/find_end.h @@ -91,7 +91,7 @@ class _Sent2, class _Proj1, class _Proj2> -_LIBCPP_CONSTEXPR_AFTER_CXX17 _Iter1 __find_end( +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 _Iter1 __find_end( _Iter1 __first1, _Sent1 __sent1, _Iter2 __first2, @@ -144,7 +144,7 @@ class _Sent2, class _Proj1, class _Proj2> -_LIBCPP_CONSTEXPR_AFTER_CXX11 _Iter1 __find_end( +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 _Iter1 __find_end( _Iter1 __first1, _Sent1 __sent1, _Iter2 __first2, diff --git a/libcxx/include/__algorithm/find_first_of.h b/libcxx/include/__algorithm/find_first_of.h --- a/libcxx/include/__algorithm/find_first_of.h +++ b/libcxx/include/__algorithm/find_first_of.h @@ -21,6 +21,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD template +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 _ForwardIterator1 __find_first_of_ce(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, diff --git a/libcxx/include/__algorithm/inplace_merge.h b/libcxx/include/__algorithm/inplace_merge.h --- a/libcxx/include/__algorithm/inplace_merge.h +++ b/libcxx/include/__algorithm/inplace_merge.h @@ -57,6 +57,7 @@ template +_LIBCPP_HIDE_FROM_ABI void __half_inplace_merge(_InputIterator1 __first1, _Sent1 __last1, _InputIterator2 __first2, _Sent2 __last2, _OutputIterator __result, _Compare&& __comp) @@ -84,6 +85,7 @@ } template +_LIBCPP_HIDE_FROM_ABI void __buffered_inplace_merge( _BidirectionalIterator __first, _BidirectionalIterator __middle, diff --git a/libcxx/include/__algorithm/is_partitioned.h b/libcxx/include/__algorithm/is_partitioned.h --- a/libcxx/include/__algorithm/is_partitioned.h +++ b/libcxx/include/__algorithm/is_partitioned.h @@ -18,7 +18,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD template -_LIBCPP_NODISCARD_EXT _LIBCPP_CONSTEXPR_AFTER_CXX17 bool +_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 bool is_partitioned(_InputIterator __first, _InputIterator __last, _Predicate __pred) { for (; __first != __last; ++__first) diff --git a/libcxx/include/__algorithm/is_permutation.h b/libcxx/include/__algorithm/is_permutation.h --- a/libcxx/include/__algorithm/is_permutation.h +++ b/libcxx/include/__algorithm/is_permutation.h @@ -23,7 +23,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD template -_LIBCPP_NODISCARD_EXT _LIBCPP_CONSTEXPR_AFTER_CXX17 bool +_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 bool is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, _BinaryPredicate __pred) { // shorten sequences as much as possible by lopping of any equal prefix @@ -77,7 +77,7 @@ #if _LIBCPP_STD_VER > 11 template -_LIBCPP_CONSTEXPR_AFTER_CXX17 bool +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 bool __is_permutation(_ForwardIterator1 __first1, _ForwardIterator1 __last1, _ForwardIterator2 __first2, _ForwardIterator2 __last2, _BinaryPredicate __pred, forward_iterator_tag, forward_iterator_tag) { // shorten sequences as much as possible by lopping of any equal prefix @@ -126,6 +126,7 @@ } template +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 bool __is_permutation(_RandomAccessIterator1 __first1, _RandomAccessIterator2 __last1, _RandomAccessIterator1 __first2, _RandomAccessIterator2 __last2, _BinaryPredicate __pred, random_access_iterator_tag, diff --git a/libcxx/include/__algorithm/lexicographical_compare.h b/libcxx/include/__algorithm/lexicographical_compare.h --- a/libcxx/include/__algorithm/lexicographical_compare.h +++ b/libcxx/include/__algorithm/lexicographical_compare.h @@ -21,7 +21,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD template -_LIBCPP_CONSTEXPR_AFTER_CXX17 bool +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 bool __lexicographical_compare(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, _Compare __comp) { diff --git a/libcxx/include/__algorithm/merge.h b/libcxx/include/__algorithm/merge.h --- a/libcxx/include/__algorithm/merge.h +++ b/libcxx/include/__algorithm/merge.h @@ -22,7 +22,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD template -_LIBCPP_CONSTEXPR_AFTER_CXX17 +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 _OutputIterator __merge(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp) diff --git a/libcxx/include/__algorithm/minmax_element.h b/libcxx/include/__algorithm/minmax_element.h --- a/libcxx/include/__algorithm/minmax_element.h +++ b/libcxx/include/__algorithm/minmax_element.h @@ -79,7 +79,7 @@ } template -_LIBCPP_NODISCARD_EXT _LIBCPP_CONSTEXPR_AFTER_CXX11 +_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 pair<_ForwardIterator, _ForwardIterator> minmax_element(_ForwardIterator __first, _ForwardIterator __last, _Compare __comp) { static_assert(__is_cpp17_forward_iterator<_ForwardIterator>::value, diff --git a/libcxx/include/__algorithm/next_permutation.h b/libcxx/include/__algorithm/next_permutation.h --- a/libcxx/include/__algorithm/next_permutation.h +++ b/libcxx/include/__algorithm/next_permutation.h @@ -23,7 +23,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD template -_LIBCPP_CONSTEXPR_AFTER_CXX17 bool +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 bool __next_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last, _Compare __comp) { _BidirectionalIterator __i = __last; diff --git a/libcxx/include/__algorithm/nth_element.h b/libcxx/include/__algorithm/nth_element.h --- a/libcxx/include/__algorithm/nth_element.h +++ b/libcxx/include/__algorithm/nth_element.h @@ -26,7 +26,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD template -_LIBCPP_CONSTEXPR_AFTER_CXX11 bool +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 bool __nth_element_find_guard(_RandomAccessIterator& __i, _RandomAccessIterator& __j, _RandomAccessIterator __m, _Compare __comp) { @@ -42,7 +42,7 @@ } template -_LIBCPP_CONSTEXPR_AFTER_CXX11 void +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 void __nth_element(_RandomAccessIterator __first, _RandomAccessIterator __nth, _RandomAccessIterator __last, _Compare __comp) { using _Ops = _IterOps<_AlgPolicy>; diff --git a/libcxx/include/__algorithm/partial_sort.h b/libcxx/include/__algorithm/partial_sort.h --- a/libcxx/include/__algorithm/partial_sort.h +++ b/libcxx/include/__algorithm/partial_sort.h @@ -29,7 +29,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD template -_LIBCPP_CONSTEXPR_AFTER_CXX17 +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 _RandomAccessIterator __partial_sort_impl( _RandomAccessIterator __first, _RandomAccessIterator __middle, _Sentinel __last, _Compare __comp) { if (__first == __middle) { @@ -55,7 +55,7 @@ } template -_LIBCPP_CONSTEXPR_AFTER_CXX17 +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 _RandomAccessIterator __partial_sort(_RandomAccessIterator __first, _RandomAccessIterator __middle, _Sentinel __last, _Compare& __comp) { if (__first == __middle) diff --git a/libcxx/include/__algorithm/partial_sort_copy.h b/libcxx/include/__algorithm/partial_sort_copy.h --- a/libcxx/include/__algorithm/partial_sort_copy.h +++ b/libcxx/include/__algorithm/partial_sort_copy.h @@ -25,7 +25,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD template -_LIBCPP_CONSTEXPR_AFTER_CXX17 _RandomAccessIterator +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 _RandomAccessIterator __partial_sort_copy(_InputIterator __first, _InputIterator __last, _RandomAccessIterator __result_first, _RandomAccessIterator __result_last, _Compare __comp) { diff --git a/libcxx/include/__algorithm/partition.h b/libcxx/include/__algorithm/partition.h --- a/libcxx/include/__algorithm/partition.h +++ b/libcxx/include/__algorithm/partition.h @@ -23,7 +23,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD template -_LIBCPP_CONSTEXPR_AFTER_CXX17 pair<_ForwardIterator, _ForwardIterator> +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 pair<_ForwardIterator, _ForwardIterator> __partition_impl(_ForwardIterator __first, _Sentinel __last, _Predicate __pred, forward_iterator_tag) { while (true) @@ -48,7 +48,7 @@ } template -_LIBCPP_CONSTEXPR_AFTER_CXX17 pair<_BidirectionalIterator, _BidirectionalIterator> +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 pair<_BidirectionalIterator, _BidirectionalIterator> __partition_impl(_BidirectionalIterator __first, _Sentinel __sentinel, _Predicate __pred, bidirectional_iterator_tag) { diff --git a/libcxx/include/__algorithm/partition_copy.h b/libcxx/include/__algorithm/partition_copy.h --- a/libcxx/include/__algorithm/partition_copy.h +++ b/libcxx/include/__algorithm/partition_copy.h @@ -21,7 +21,7 @@ template -_LIBCPP_CONSTEXPR_AFTER_CXX17 pair<_OutputIterator1, _OutputIterator2> +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 pair<_OutputIterator1, _OutputIterator2> partition_copy(_InputIterator __first, _InputIterator __last, _OutputIterator1 __out_true, _OutputIterator2 __out_false, _Predicate __pred) diff --git a/libcxx/include/__algorithm/partition_point.h b/libcxx/include/__algorithm/partition_point.h --- a/libcxx/include/__algorithm/partition_point.h +++ b/libcxx/include/__algorithm/partition_point.h @@ -22,7 +22,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD template -_LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator partition_point(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred) { typedef typename iterator_traits<_ForwardIterator>::difference_type difference_type; diff --git a/libcxx/include/__algorithm/prev_permutation.h b/libcxx/include/__algorithm/prev_permutation.h --- a/libcxx/include/__algorithm/prev_permutation.h +++ b/libcxx/include/__algorithm/prev_permutation.h @@ -23,7 +23,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD template -_LIBCPP_CONSTEXPR_AFTER_CXX17 bool +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 bool __prev_permutation(_BidirectionalIterator __first, _BidirectionalIterator __last, _Compare __comp) { _BidirectionalIterator __i = __last; diff --git a/libcxx/include/__algorithm/remove.h b/libcxx/include/__algorithm/remove.h --- a/libcxx/include/__algorithm/remove.h +++ b/libcxx/include/__algorithm/remove.h @@ -21,7 +21,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD template -_LIBCPP_NODISCARD_EXT _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator +_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator remove(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value) { __first = _VSTD::find(__first, __last, __value); diff --git a/libcxx/include/__algorithm/remove_if.h b/libcxx/include/__algorithm/remove_if.h --- a/libcxx/include/__algorithm/remove_if.h +++ b/libcxx/include/__algorithm/remove_if.h @@ -20,7 +20,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD template -_LIBCPP_NODISCARD_EXT _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator +_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator remove_if(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred) { __first = _VSTD::find_if<_ForwardIterator, _Predicate&>(__first, __last, __pred); diff --git a/libcxx/include/__algorithm/rotate.h b/libcxx/include/__algorithm/rotate.h --- a/libcxx/include/__algorithm/rotate.h +++ b/libcxx/include/__algorithm/rotate.h @@ -28,7 +28,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD template -_LIBCPP_CONSTEXPR_AFTER_CXX11 _ForwardIterator +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 _ForwardIterator __rotate_left(_ForwardIterator __first, _ForwardIterator __last) { typedef typename iterator_traits<_ForwardIterator>::value_type value_type; @@ -40,7 +40,7 @@ } template -_LIBCPP_CONSTEXPR_AFTER_CXX11 _BidirectionalIterator +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 _BidirectionalIterator __rotate_right(_BidirectionalIterator __first, _BidirectionalIterator __last) { typedef typename iterator_traits<_BidirectionalIterator>::value_type value_type; @@ -54,7 +54,7 @@ } template -_LIBCPP_CONSTEXPR_AFTER_CXX14 _ForwardIterator +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX14 _ForwardIterator __rotate_forward(_ForwardIterator __first, _ForwardIterator __middle, _ForwardIterator __last) { _ForwardIterator __i = __middle; @@ -103,7 +103,7 @@ } template -_LIBCPP_CONSTEXPR_AFTER_CXX14 _RandomAccessIterator +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX14 _RandomAccessIterator __rotate_gcd(_RandomAccessIterator __first, _RandomAccessIterator __middle, _RandomAccessIterator __last) { typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type; diff --git a/libcxx/include/__algorithm/shuffle.h b/libcxx/include/__algorithm/shuffle.h --- a/libcxx/include/__algorithm/shuffle.h +++ b/libcxx/include/__algorithm/shuffle.h @@ -137,7 +137,7 @@ #endif template -_RandomAccessIterator __shuffle( +_LIBCPP_HIDE_FROM_ABI _RandomAccessIterator __shuffle( _RandomAccessIterator __first, _Sentinel __last_sentinel, _UniformRandomNumberGenerator&& __g) { typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type; typedef uniform_int_distribution _Dp; @@ -161,8 +161,8 @@ } template -void shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last, - _UniformRandomNumberGenerator&& __g) { +_LIBCPP_HIDE_FROM_ABI void +shuffle(_RandomAccessIterator __first, _RandomAccessIterator __last, _UniformRandomNumberGenerator&& __g) { (void)std::__shuffle<_ClassicAlgPolicy>( std::move(__first), std::move(__last), std::forward<_UniformRandomNumberGenerator>(__g)); } diff --git a/libcxx/include/__algorithm/sift_down.h b/libcxx/include/__algorithm/sift_down.h --- a/libcxx/include/__algorithm/sift_down.h +++ b/libcxx/include/__algorithm/sift_down.h @@ -22,7 +22,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD template -_LIBCPP_CONSTEXPR_AFTER_CXX11 void +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 void __sift_down(_RandomAccessIterator __first, _Compare __comp, typename iterator_traits<_RandomAccessIterator>::difference_type __len, _RandomAccessIterator __start) @@ -78,7 +78,7 @@ } template -_LIBCPP_CONSTEXPR_AFTER_CXX11 _RandomAccessIterator +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 _RandomAccessIterator __floyd_sift_down(_RandomAccessIterator __first, _Compare __comp, typename iterator_traits<_RandomAccessIterator>::difference_type __len) { diff --git a/libcxx/include/__algorithm/sort.h b/libcxx/include/__algorithm/sort.h --- a/libcxx/include/__algorithm/sort.h +++ b/libcxx/include/__algorithm/sort.h @@ -80,6 +80,7 @@ // stable, 2-3 compares, 0-2 swaps template +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 unsigned __sort3(_ForwardIterator __x, _ForwardIterator __y, _ForwardIterator __z, _Compare __c) { using _Ops = _IterOps<_AlgPolicy>; @@ -118,6 +119,7 @@ // stable, 3-6 compares, 0-5 swaps template +_LIBCPP_HIDE_FROM_ABI unsigned __sort4(_ForwardIterator __x1, _ForwardIterator __x2, _ForwardIterator __x3, _ForwardIterator __x4, _Compare __c) { using _Ops = _IterOps<_AlgPolicy>; @@ -281,6 +283,7 @@ // Assumes size > 0 template +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 void __selection_sort(_BidirectionalIterator __first, _BidirectionalIterator __last, _Compare __comp) { _BidirectionalIterator __lm1 = __last; @@ -292,6 +295,7 @@ } template +_LIBCPP_HIDE_FROM_ABI void __insertion_sort(_BidirectionalIterator __first, _BidirectionalIterator __last, _Compare __comp) { using _Ops = _IterOps<_AlgPolicy>; @@ -309,6 +313,7 @@ } template +_LIBCPP_HIDE_FROM_ABI void __insertion_sort_3(_RandomAccessIterator __first, _RandomAccessIterator __last, _Compare __comp) { using _Ops = _IterOps<_AlgPolicy>; @@ -332,7 +337,7 @@ } template -bool __insertion_sort_incomplete( +_LIBCPP_HIDDEN bool __insertion_sort_incomplete( _RandomAccessIterator __first, _RandomAccessIterator __last, _WrappedComp __wrapped_comp) { using _Unwrap = _UnwrapAlgPolicy<_WrappedComp>; using _AlgPolicy = typename _Unwrap::_AlgPolicy; @@ -387,6 +392,7 @@ } template +_LIBCPP_HIDE_FROM_ABI void __insertion_sort_move(_BidirectionalIterator __first1, _BidirectionalIterator __last1, typename iterator_traits<_BidirectionalIterator>::value_type* __first2, _Compare __comp) { using _Ops = _IterOps<_AlgPolicy>; @@ -616,7 +622,7 @@ } template -void __sort(_RandomAccessIterator __first, _RandomAccessIterator __last, _WrappedComp __wrapped_comp) { +_LIBCPP_HIDDEN void __sort(_RandomAccessIterator __first, _RandomAccessIterator __last, _WrappedComp __wrapped_comp) { typedef typename iterator_traits<_RandomAccessIterator>::difference_type difference_type; difference_type __depth_limit = 2 * __log2i(__last - __first); diff --git a/libcxx/include/__algorithm/stable_partition.h b/libcxx/include/__algorithm/stable_partition.h --- a/libcxx/include/__algorithm/stable_partition.h +++ b/libcxx/include/__algorithm/stable_partition.h @@ -25,7 +25,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD template -_ForwardIterator +_LIBCPP_HIDE_FROM_ABI _ForwardIterator __stable_partition_impl(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred, _Distance __len, _Pair __p, forward_iterator_tag __fit) { @@ -114,7 +114,7 @@ } template -_ForwardIterator +_LIBCPP_HIDE_FROM_ABI _ForwardIterator __stable_partition_impl(_ForwardIterator __first, _ForwardIterator __last, _Predicate __pred, forward_iterator_tag) { @@ -259,7 +259,7 @@ } template -_BidirectionalIterator +_LIBCPP_HIDE_FROM_ABI _BidirectionalIterator __stable_partition_impl(_BidirectionalIterator __first, _BidirectionalIterator __last, _Predicate __pred, bidirectional_iterator_tag) { diff --git a/libcxx/include/__algorithm/stable_sort.h b/libcxx/include/__algorithm/stable_sort.h --- a/libcxx/include/__algorithm/stable_sort.h +++ b/libcxx/include/__algorithm/stable_sort.h @@ -27,7 +27,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD template -void +_LIBCPP_HIDE_FROM_ABI void __merge_move_construct(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, typename iterator_traits<_InputIterator1>::value_type* __result, _Compare __comp) @@ -69,7 +69,7 @@ } template -void +_LIBCPP_HIDE_FROM_ABI void __merge_move_assign(_InputIterator1 __first1, _InputIterator1 __last1, _InputIterator2 __first2, _InputIterator2 __last2, _OutputIterator __result, _Compare __comp) diff --git a/libcxx/include/__bit_reference b/libcxx/include/__bit_reference --- a/libcxx/include/__bit_reference +++ b/libcxx/include/__bit_reference @@ -176,7 +176,7 @@ // find template -_LIBCPP_CONSTEXPR_AFTER_CXX17 __bit_iterator<_Cp, _IsConst> +_LIBCPP_CONSTEXPR_AFTER_CXX17 _LIBCPP_HIDE_FROM_ABI __bit_iterator<_Cp, _IsConst> __find_bool_true(__bit_iterator<_Cp, _IsConst> __first, typename _Cp::size_type __n) { typedef __bit_iterator<_Cp, _IsConst> _It; @@ -212,7 +212,7 @@ } template -_LIBCPP_CONSTEXPR_AFTER_CXX17 __bit_iterator<_Cp, _IsConst> +_LIBCPP_CONSTEXPR_AFTER_CXX17 _LIBCPP_HIDE_FROM_ABI __bit_iterator<_Cp, _IsConst> __find_bool_false(__bit_iterator<_Cp, _IsConst> __first, typename _Cp::size_type __n) { typedef __bit_iterator<_Cp, _IsConst> _It; @@ -263,7 +263,7 @@ // count template -typename __bit_iterator<_Cp, _IsConst>::difference_type +_LIBCPP_HIDE_FROM_ABI typename __bit_iterator<_Cp, _IsConst>::difference_type __count_bool_true(__bit_iterator<_Cp, _IsConst> __first, typename _Cp::size_type __n) { typedef __bit_iterator<_Cp, _IsConst> _It; @@ -294,7 +294,7 @@ } template -typename __bit_iterator<_Cp, _IsConst>::difference_type +_LIBCPP_HIDE_FROM_ABI typename __bit_iterator<_Cp, _IsConst>::difference_type __count_bool_false(__bit_iterator<_Cp, _IsConst> __first, typename _Cp::size_type __n) { typedef __bit_iterator<_Cp, _IsConst> _It; @@ -337,7 +337,7 @@ // fill_n template -_LIBCPP_CONSTEXPR_AFTER_CXX17 void +_LIBCPP_CONSTEXPR_AFTER_CXX17 _LIBCPP_HIDE_FROM_ABI void __fill_n_false(__bit_iterator<_Cp, false> __first, typename _Cp::size_type __n) { typedef __bit_iterator<_Cp, false> _It; @@ -367,7 +367,7 @@ } template -_LIBCPP_CONSTEXPR_AFTER_CXX17 void +_LIBCPP_CONSTEXPR_AFTER_CXX17 _LIBCPP_HIDE_FROM_ABI void __fill_n_true(__bit_iterator<_Cp, false> __first, typename _Cp::size_type __n) { typedef __bit_iterator<_Cp, false> _It; @@ -424,8 +424,7 @@ // copy template -_LIBCPP_CONSTEXPR_AFTER_CXX17 -__bit_iterator<_Cp, false> +_LIBCPP_CONSTEXPR_AFTER_CXX17 _LIBCPP_HIDE_FROM_ABI __bit_iterator<_Cp, false> __copy_aligned(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __last, __bit_iterator<_Cp, false> __result) { @@ -472,8 +471,7 @@ } template -_LIBCPP_CONSTEXPR_AFTER_CXX17 -__bit_iterator<_Cp, false> +_LIBCPP_CONSTEXPR_AFTER_CXX17 _LIBCPP_HIDE_FROM_ABI __bit_iterator<_Cp, false> __copy_unaligned(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __last, __bit_iterator<_Cp, false> __result) { @@ -563,7 +561,7 @@ // copy_backward template -_LIBCPP_CONSTEXPR_AFTER_CXX17 __bit_iterator<_Cp, false> +_LIBCPP_CONSTEXPR_AFTER_CXX17 _LIBCPP_HIDE_FROM_ABI __bit_iterator<_Cp, false> __copy_backward_aligned(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __last, __bit_iterator<_Cp, false> __result) { @@ -610,7 +608,7 @@ } template -_LIBCPP_CONSTEXPR_AFTER_CXX17 __bit_iterator<_Cp, false> +_LIBCPP_CONSTEXPR_AFTER_CXX17 _LIBCPP_HIDE_FROM_ABI __bit_iterator<_Cp, false> __copy_backward_unaligned(__bit_iterator<_Cp, _IsConst> __first, __bit_iterator<_Cp, _IsConst> __last, __bit_iterator<_Cp, false> __result) { @@ -728,7 +726,7 @@ // swap_ranges template -__bit_iterator<__C2, false> +_LIBCPP_HIDE_FROM_ABI __bit_iterator<__C2, false> __swap_ranges_aligned(__bit_iterator<__C1, false> __first, __bit_iterator<__C1, false> __last, __bit_iterator<__C2, false> __result) { @@ -778,7 +776,7 @@ } template -__bit_iterator<__C2, false> +_LIBCPP_HIDE_FROM_ABI __bit_iterator<__C2, false> __swap_ranges_unaligned(__bit_iterator<__C1, false> __first, __bit_iterator<__C1, false> __last, __bit_iterator<__C2, false> __result) { @@ -923,7 +921,7 @@ }; template -_LIBCPP_CONSTEXPR_AFTER_CXX17 __bit_iterator<_Cp, false> +_LIBCPP_CONSTEXPR_AFTER_CXX17 _LIBCPP_HIDE_FROM_ABI __bit_iterator<_Cp, false> rotate(__bit_iterator<_Cp, false> __first, __bit_iterator<_Cp, false> __middle, __bit_iterator<_Cp, false> __last) { typedef __bit_iterator<_Cp, false> _I1; @@ -974,7 +972,7 @@ // equal template -_LIBCPP_CONSTEXPR_AFTER_CXX17 bool +_LIBCPP_CONSTEXPR_AFTER_CXX17 _LIBCPP_HIDE_FROM_ABI bool __equal_unaligned(__bit_iterator<_Cp, _IC1> __first1, __bit_iterator<_Cp, _IC1> __last1, __bit_iterator<_Cp, _IC2> __first2) { @@ -1056,7 +1054,7 @@ } template -_LIBCPP_CONSTEXPR_AFTER_CXX17 bool +_LIBCPP_CONSTEXPR_AFTER_CXX17 _LIBCPP_HIDE_FROM_ABI bool __equal_aligned(__bit_iterator<_Cp, _IC1> __first1, __bit_iterator<_Cp, _IC1> __last1, __bit_iterator<_Cp, _IC2> __first2) { diff --git a/libcxx/include/__chrono/duration.h b/libcxx/include/__chrono/duration.h --- a/libcxx/include/__chrono/duration.h +++ b/libcxx/include/__chrono/duration.h @@ -534,67 +534,67 @@ inline namespace chrono_literals { - constexpr chrono::hours operator""h(unsigned long long __h) + _LIBCPP_HIDE_FROM_ABI constexpr chrono::hours operator""h(unsigned long long __h) { return chrono::hours(static_cast(__h)); } - constexpr chrono::duration> operator""h(long double __h) + _LIBCPP_HIDE_FROM_ABI constexpr chrono::duration> operator""h(long double __h) { return chrono::duration>(__h); } - constexpr chrono::minutes operator""min(unsigned long long __m) + _LIBCPP_HIDE_FROM_ABI constexpr chrono::minutes operator""min(unsigned long long __m) { return chrono::minutes(static_cast(__m)); } - constexpr chrono::duration> operator""min(long double __m) + _LIBCPP_HIDE_FROM_ABI constexpr chrono::duration> operator""min(long double __m) { return chrono::duration> (__m); } - constexpr chrono::seconds operator""s(unsigned long long __s) + _LIBCPP_HIDE_FROM_ABI constexpr chrono::seconds operator""s(unsigned long long __s) { return chrono::seconds(static_cast(__s)); } - constexpr chrono::duration operator""s(long double __s) + _LIBCPP_HIDE_FROM_ABI constexpr chrono::duration operator""s(long double __s) { return chrono::duration (__s); } - constexpr chrono::milliseconds operator""ms(unsigned long long __ms) + _LIBCPP_HIDE_FROM_ABI constexpr chrono::milliseconds operator""ms(unsigned long long __ms) { return chrono::milliseconds(static_cast(__ms)); } - constexpr chrono::duration operator""ms(long double __ms) + _LIBCPP_HIDE_FROM_ABI constexpr chrono::duration operator""ms(long double __ms) { return chrono::duration(__ms); } - constexpr chrono::microseconds operator""us(unsigned long long __us) + _LIBCPP_HIDE_FROM_ABI constexpr chrono::microseconds operator""us(unsigned long long __us) { return chrono::microseconds(static_cast(__us)); } - constexpr chrono::duration operator""us(long double __us) + _LIBCPP_HIDE_FROM_ABI constexpr chrono::duration operator""us(long double __us) { return chrono::duration (__us); } - constexpr chrono::nanoseconds operator""ns(unsigned long long __ns) + _LIBCPP_HIDE_FROM_ABI constexpr chrono::nanoseconds operator""ns(unsigned long long __ns) { return chrono::nanoseconds(static_cast(__ns)); } - constexpr chrono::duration operator""ns(long double __ns) + _LIBCPP_HIDE_FROM_ABI constexpr chrono::duration operator""ns(long double __ns) { return chrono::duration (__ns); } diff --git a/libcxx/include/__format/formatter_floating_point.h b/libcxx/include/__format/formatter_floating_point.h --- a/libcxx/include/__format/formatter_floating_point.h +++ b/libcxx/include/__format/formatter_floating_point.h @@ -103,7 +103,7 @@ struct __traits; template -static constexpr size_t __float_buffer_size(int __precision) { +_LIBCPP_HIDE_FROM_ABI constexpr size_t __float_buffer_size(int __precision) { using _Traits = __traits<_Fp>; return 4 + _Traits::__max_integral + __precision + _Traits::__max_fractional_value; } diff --git a/libcxx/include/__functional/invoke.h b/libcxx/include/__functional/invoke.h --- a/libcxx/include/__functional/invoke.h +++ b/libcxx/include/__functional/invoke.h @@ -524,7 +524,7 @@ using invoke_result_t = typename invoke_result<_Fn, _Args...>::type; template -_LIBCPP_CONSTEXPR_AFTER_CXX17 invoke_result_t<_Fn, _Args...> +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 invoke_result_t<_Fn, _Args...> invoke(_Fn&& __f, _Args&&... __args) noexcept(is_nothrow_invocable_v<_Fn, _Args...>) { diff --git a/libcxx/include/__iterator/common_iterator.h b/libcxx/include/__iterator/common_iterator.h --- a/libcxx/include/__iterator/common_iterator.h +++ b/libcxx/include/__iterator/common_iterator.h @@ -147,6 +147,7 @@ template _S2> requires sentinel_for<_Sent, _I2> + _LIBCPP_HIDE_FROM_ABI friend constexpr bool operator==(const common_iterator& __x, const common_iterator<_I2, _S2>& __y) { _LIBCPP_ASSERT(!__x.__hold_.valueless_by_exception(), "Attempted to compare a valueless common_iterator"); _LIBCPP_ASSERT(!__y.__hold_.valueless_by_exception(), "Attempted to compare a valueless common_iterator"); @@ -165,6 +166,7 @@ template _S2> requires sentinel_for<_Sent, _I2> && equality_comparable_with<_Iter, _I2> + _LIBCPP_HIDE_FROM_ABI friend constexpr bool operator==(const common_iterator& __x, const common_iterator<_I2, _S2>& __y) { _LIBCPP_ASSERT(!__x.__hold_.valueless_by_exception(), "Attempted to compare a valueless common_iterator"); _LIBCPP_ASSERT(!__y.__hold_.valueless_by_exception(), "Attempted to compare a valueless common_iterator"); @@ -186,6 +188,7 @@ template _I2, sized_sentinel_for<_Iter> _S2> requires sized_sentinel_for<_Sent, _I2> + _LIBCPP_HIDE_FROM_ABI friend constexpr iter_difference_t<_I2> operator-(const common_iterator& __x, const common_iterator<_I2, _S2>& __y) { _LIBCPP_ASSERT(!__x.__hold_.valueless_by_exception(), "Attempted to subtract from a valueless common_iterator"); _LIBCPP_ASSERT(!__y.__hold_.valueless_by_exception(), "Attempted to subtract a valueless common_iterator"); @@ -205,7 +208,7 @@ return _VSTD::__unchecked_get<_Sent>(__x.__hold_) - _VSTD::__unchecked_get<_I2>(__y.__hold_); } - friend constexpr iter_rvalue_reference_t<_Iter> iter_move(const common_iterator& __i) + _LIBCPP_HIDE_FROM_ABI friend constexpr iter_rvalue_reference_t<_Iter> iter_move(const common_iterator& __i) noexcept(noexcept(ranges::iter_move(declval()))) requires input_iterator<_Iter> { @@ -214,7 +217,7 @@ } template _I2, class _S2> - friend constexpr void iter_swap(const common_iterator& __x, const common_iterator<_I2, _S2>& __y) + _LIBCPP_HIDE_FROM_ABI friend constexpr void iter_swap(const common_iterator& __x, const common_iterator<_I2, _S2>& __y) noexcept(noexcept(ranges::iter_swap(declval(), declval()))) { _LIBCPP_ASSERT(holds_alternative<_Iter>(__x.__hold_), "Attempted to iter_swap a non-dereferenceable common_iterator"); diff --git a/libcxx/include/__iterator/counted_iterator.h b/libcxx/include/__iterator/counted_iterator.h --- a/libcxx/include/__iterator/counted_iterator.h +++ b/libcxx/include/__iterator/counted_iterator.h @@ -263,7 +263,7 @@ } template _I2> - friend constexpr strong_ordering operator<=>( + _LIBCPP_HIDE_FROM_ABI friend constexpr strong_ordering operator<=>( const counted_iterator& __lhs, const counted_iterator<_I2>& __rhs) { return __rhs.__count_ <=> __lhs.__count_; diff --git a/libcxx/include/__memory/shared_ptr.h b/libcxx/include/__memory/shared_ptr.h --- a/libcxx/include/__memory/shared_ptr.h +++ b/libcxx/include/__memory/shared_ptr.h @@ -1355,7 +1355,7 @@ } template -shared_ptr<_Tp> +_LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> const_pointer_cast(const shared_ptr<_Up>& __r) _NOEXCEPT { typedef typename shared_ptr<_Tp>::element_type _RTp; @@ -1363,7 +1363,7 @@ } template -shared_ptr<_Tp> +_LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> reinterpret_pointer_cast(const shared_ptr<_Up>& __r) _NOEXCEPT { return shared_ptr<_Tp>(__r, @@ -1797,7 +1797,7 @@ template _LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR -shared_ptr<_Tp> +_LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> atomic_load(const shared_ptr<_Tp>* __p) { __sp_mut& __m = __get_sp_mut(__p); @@ -1818,7 +1818,7 @@ template _LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR -void +_LIBCPP_HIDE_FROM_ABI void atomic_store(shared_ptr<_Tp>* __p, shared_ptr<_Tp> __r) { __sp_mut& __m = __get_sp_mut(__p); @@ -1838,7 +1838,7 @@ template _LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR -shared_ptr<_Tp> +_LIBCPP_HIDE_FROM_ABI shared_ptr<_Tp> atomic_exchange(shared_ptr<_Tp>* __p, shared_ptr<_Tp> __r) { __sp_mut& __m = __get_sp_mut(__p); @@ -1859,7 +1859,7 @@ template _LIBCPP_AVAILABILITY_ATOMIC_SHARED_PTR -bool +_LIBCPP_HIDE_FROM_ABI bool atomic_compare_exchange_strong(shared_ptr<_Tp>* __p, shared_ptr<_Tp>* __v, shared_ptr<_Tp> __w) { shared_ptr<_Tp> __temp; diff --git a/libcxx/include/__memory/temporary_buffer.h b/libcxx/include/__memory/temporary_buffer.h --- a/libcxx/include/__memory/temporary_buffer.h +++ b/libcxx/include/__memory/temporary_buffer.h @@ -23,7 +23,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD template -_LIBCPP_NODISCARD_EXT _LIBCPP_NO_CFI _LIBCPP_DEPRECATED_IN_CXX17 +_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI _LIBCPP_NO_CFI _LIBCPP_DEPRECATED_IN_CXX17 pair<_Tp*, ptrdiff_t> get_temporary_buffer(ptrdiff_t __n) _NOEXCEPT { diff --git a/libcxx/include/__memory/uninitialized_algorithms.h b/libcxx/include/__memory/uninitialized_algorithms.h --- a/libcxx/include/__memory/uninitialized_algorithms.h +++ b/libcxx/include/__memory/uninitialized_algorithms.h @@ -64,6 +64,7 @@ } template +_LIBCPP_HIDE_FROM_ABI _ForwardIterator uninitialized_copy(_InputIterator __ifirst, _InputIterator __ilast, _ForwardIterator __ofirst) { typedef typename iterator_traits<_ForwardIterator>::value_type _ValueType; diff --git a/libcxx/include/__numeric/midpoint.h b/libcxx/include/__numeric/midpoint.h --- a/libcxx/include/__numeric/midpoint.h +++ b/libcxx/include/__numeric/midpoint.h @@ -55,12 +55,12 @@ template -constexpr int __sign(_Tp __val) { +_LIBCPP_HIDE_FROM_ABI constexpr int __sign(_Tp __val) { return (_Tp(0) < __val) - (__val < _Tp(0)); } template -constexpr _Fp __fp_abs(_Fp __f) { return __f >= 0 ? __f : -__f; } +_LIBCPP_HIDE_FROM_ABI constexpr _Fp __fp_abs(_Fp __f) { return __f >= 0 ? __f : -__f; } template _LIBCPP_INLINE_VISIBILITY constexpr diff --git a/libcxx/include/__random/bernoulli_distribution.h b/libcxx/include/__random/bernoulli_distribution.h --- a/libcxx/include/__random/bernoulli_distribution.h +++ b/libcxx/include/__random/bernoulli_distribution.h @@ -110,7 +110,7 @@ } template -basic_ostream<_CharT, _Traits>& +_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, const bernoulli_distribution& __x) { __save_flags<_CharT, _Traits> __lx(__os); @@ -123,7 +123,7 @@ } template -basic_istream<_CharT, _Traits>& +_LIBCPP_HIDE_FROM_ABI basic_istream<_CharT, _Traits>& operator>>(basic_istream<_CharT, _Traits>& __is, bernoulli_distribution& __x) { typedef bernoulli_distribution _Eng; diff --git a/libcxx/include/__random/binomial_distribution.h b/libcxx/include/__random/binomial_distribution.h --- a/libcxx/include/__random/binomial_distribution.h +++ b/libcxx/include/__random/binomial_distribution.h @@ -189,7 +189,7 @@ } template -basic_ostream<_CharT, _Traits>& +_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, const binomial_distribution<_IntType>& __x) { @@ -203,7 +203,7 @@ } template -basic_istream<_CharT, _Traits>& +_LIBCPP_HIDE_FROM_ABI basic_istream<_CharT, _Traits>& operator>>(basic_istream<_CharT, _Traits>& __is, binomial_distribution<_IntType>& __x) { diff --git a/libcxx/include/__random/cauchy_distribution.h b/libcxx/include/__random/cauchy_distribution.h --- a/libcxx/include/__random/cauchy_distribution.h +++ b/libcxx/include/__random/cauchy_distribution.h @@ -124,7 +124,7 @@ } template -basic_ostream<_CharT, _Traits>& +_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, const cauchy_distribution<_RT>& __x) { @@ -139,7 +139,7 @@ } template -basic_istream<_CharT, _Traits>& +_LIBCPP_HIDE_FROM_ABI basic_istream<_CharT, _Traits>& operator>>(basic_istream<_CharT, _Traits>& __is, cauchy_distribution<_RT>& __x) { diff --git a/libcxx/include/__random/chi_squared_distribution.h b/libcxx/include/__random/chi_squared_distribution.h --- a/libcxx/include/__random/chi_squared_distribution.h +++ b/libcxx/include/__random/chi_squared_distribution.h @@ -107,7 +107,7 @@ }; template -basic_ostream<_CharT, _Traits>& +_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, const chi_squared_distribution<_RT>& __x) { @@ -120,7 +120,7 @@ } template -basic_istream<_CharT, _Traits>& +_LIBCPP_HIDE_FROM_ABI basic_istream<_CharT, _Traits>& operator>>(basic_istream<_CharT, _Traits>& __is, chi_squared_distribution<_RT>& __x) { diff --git a/libcxx/include/__random/discard_block_engine.h b/libcxx/include/__random/discard_block_engine.h --- a/libcxx/include/__random/discard_block_engine.h +++ b/libcxx/include/__random/discard_block_engine.h @@ -164,7 +164,7 @@ template -basic_ostream<_CharT, _Traits>& +_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, const discard_block_engine<_Eng, _Pp, _Rp>& __x) { @@ -178,7 +178,7 @@ template -basic_istream<_CharT, _Traits>& +_LIBCPP_HIDE_FROM_ABI basic_istream<_CharT, _Traits>& operator>>(basic_istream<_CharT, _Traits>& __is, discard_block_engine<_Eng, _Pp, _Rp>& __x) { diff --git a/libcxx/include/__random/discrete_distribution.h b/libcxx/include/__random/discrete_distribution.h --- a/libcxx/include/__random/discrete_distribution.h +++ b/libcxx/include/__random/discrete_distribution.h @@ -221,7 +221,7 @@ } template -basic_ostream<_CharT, _Traits>& +_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, const discrete_distribution<_IT>& __x) { @@ -239,7 +239,7 @@ } template -basic_istream<_CharT, _Traits>& +_LIBCPP_HIDE_FROM_ABI basic_istream<_CharT, _Traits>& operator>>(basic_istream<_CharT, _Traits>& __is, discrete_distribution<_IT>& __x) { diff --git a/libcxx/include/__random/exponential_distribution.h b/libcxx/include/__random/exponential_distribution.h --- a/libcxx/include/__random/exponential_distribution.h +++ b/libcxx/include/__random/exponential_distribution.h @@ -121,7 +121,7 @@ } template -basic_ostream<_CharT, _Traits>& +_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, const exponential_distribution<_RealType>& __x) { @@ -133,7 +133,7 @@ } template -basic_istream<_CharT, _Traits>& +_LIBCPP_HIDE_FROM_ABI basic_istream<_CharT, _Traits>& operator>>(basic_istream<_CharT, _Traits>& __is, exponential_distribution<_RealType>& __x) { diff --git a/libcxx/include/__random/extreme_value_distribution.h b/libcxx/include/__random/extreme_value_distribution.h --- a/libcxx/include/__random/extreme_value_distribution.h +++ b/libcxx/include/__random/extreme_value_distribution.h @@ -123,7 +123,7 @@ } template -basic_ostream<_CharT, _Traits>& +_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, const extreme_value_distribution<_RT>& __x) { @@ -138,7 +138,7 @@ } template -basic_istream<_CharT, _Traits>& +_LIBCPP_HIDE_FROM_ABI basic_istream<_CharT, _Traits>& operator>>(basic_istream<_CharT, _Traits>& __is, extreme_value_distribution<_RT>& __x) { diff --git a/libcxx/include/__random/fisher_f_distribution.h b/libcxx/include/__random/fisher_f_distribution.h --- a/libcxx/include/__random/fisher_f_distribution.h +++ b/libcxx/include/__random/fisher_f_distribution.h @@ -122,7 +122,7 @@ } template -basic_ostream<_CharT, _Traits>& +_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, const fisher_f_distribution<_RT>& __x) { @@ -137,7 +137,7 @@ } template -basic_istream<_CharT, _Traits>& +_LIBCPP_HIDE_FROM_ABI basic_istream<_CharT, _Traits>& operator>>(basic_istream<_CharT, _Traits>& __is, fisher_f_distribution<_RT>& __x) { diff --git a/libcxx/include/__random/gamma_distribution.h b/libcxx/include/__random/gamma_distribution.h --- a/libcxx/include/__random/gamma_distribution.h +++ b/libcxx/include/__random/gamma_distribution.h @@ -175,7 +175,7 @@ } template -basic_ostream<_CharT, _Traits>& +_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, const gamma_distribution<_RT>& __x) { @@ -190,7 +190,7 @@ } template -basic_istream<_CharT, _Traits>& +_LIBCPP_HIDE_FROM_ABI basic_istream<_CharT, _Traits>& operator>>(basic_istream<_CharT, _Traits>& __is, gamma_distribution<_RT>& __x) { diff --git a/libcxx/include/__random/generate_canonical.h b/libcxx/include/__random/generate_canonical.h --- a/libcxx/include/__random/generate_canonical.h +++ b/libcxx/include/__random/generate_canonical.h @@ -27,7 +27,7 @@ // generate_canonical template -_RealType +_LIBCPP_HIDE_FROM_ABI _RealType generate_canonical(_URNG& __g) { const size_t _Dt = numeric_limits<_RealType>::digits; diff --git a/libcxx/include/__random/geometric_distribution.h b/libcxx/include/__random/geometric_distribution.h --- a/libcxx/include/__random/geometric_distribution.h +++ b/libcxx/include/__random/geometric_distribution.h @@ -108,7 +108,7 @@ }; template -basic_ostream<_CharT, _Traits>& +_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, const geometric_distribution<_IntType>& __x) { @@ -120,7 +120,7 @@ } template -basic_istream<_CharT, _Traits>& +_LIBCPP_HIDE_FROM_ABI basic_istream<_CharT, _Traits>& operator>>(basic_istream<_CharT, _Traits>& __is, geometric_distribution<_IntType>& __x) { diff --git a/libcxx/include/__random/independent_bits_engine.h b/libcxx/include/__random/independent_bits_engine.h --- a/libcxx/include/__random/independent_bits_engine.h +++ b/libcxx/include/__random/independent_bits_engine.h @@ -244,7 +244,7 @@ template -basic_ostream<_CharT, _Traits>& +_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, const independent_bits_engine<_Eng, _Wp, _UInt>& __x) { @@ -253,7 +253,7 @@ template -basic_istream<_CharT, _Traits>& +_LIBCPP_HIDE_FROM_ABI basic_istream<_CharT, _Traits>& operator>>(basic_istream<_CharT, _Traits>& __is, independent_bits_engine<_Eng, _Wp, _UInt>& __x) { diff --git a/libcxx/include/__random/linear_congruential_engine.h b/libcxx/include/__random/linear_congruential_engine.h --- a/libcxx/include/__random/linear_congruential_engine.h +++ b/libcxx/include/__random/linear_congruential_engine.h @@ -198,7 +198,7 @@ template -basic_istream<_CharT, _Traits>& +_LIBCPP_HIDE_FROM_ABI basic_istream<_CharT, _Traits>& operator>>(basic_istream<_CharT, _Traits>& __is, linear_congruential_engine<_Up, _Ap, _Cp, _Np>& __x); @@ -372,7 +372,7 @@ template -basic_istream<_CharT, _Traits>& +_LIBCPP_HIDE_FROM_ABI basic_istream<_CharT, _Traits>& operator>>(basic_istream<_CharT, _Traits>& __is, linear_congruential_engine<_UIntType, __a, __c, __m>& __x) { diff --git a/libcxx/include/__random/mersenne_twister_engine.h b/libcxx/include/__random/mersenne_twister_engine.h --- a/libcxx/include/__random/mersenne_twister_engine.h +++ b/libcxx/include/__random/mersenne_twister_engine.h @@ -36,7 +36,7 @@ template -bool +_LIBCPP_HIDE_FROM_ABI bool operator==(const mersenne_twister_engine<_UInt, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp, _Bp, _Tp, _Cp, _Lp, _Fp>& __x, const mersenne_twister_engine<_UInt, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp, @@ -56,7 +56,7 @@ class _UInt, size_t _Wp, size_t _Np, size_t _Mp, size_t _Rp, _UInt _Ap, size_t _Up, _UInt _Dp, size_t _Sp, _UInt _Bp, size_t _Tp, _UInt _Cp, size_t _Lp, _UInt _Fp> -basic_ostream<_CharT, _Traits>& +_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, const mersenne_twister_engine<_UInt, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp, _Bp, _Tp, _Cp, _Lp, _Fp>& __x); @@ -65,7 +65,7 @@ class _UInt, size_t _Wp, size_t _Np, size_t _Mp, size_t _Rp, _UInt _Ap, size_t _Up, _UInt _Dp, size_t _Sp, _UInt _Bp, size_t _Tp, _UInt _Cp, size_t _Lp, _UInt _Fp> -basic_istream<_CharT, _Traits>& +_LIBCPP_HIDE_FROM_ABI basic_istream<_CharT, _Traits>& operator>>(basic_istream<_CharT, _Traits>& __is, mersenne_twister_engine<_UInt, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp, _Bp, _Tp, _Cp, _Lp, _Fp>& __x); @@ -416,7 +416,7 @@ template -bool +_LIBCPP_HIDE_FROM_ABI bool operator==(const mersenne_twister_engine<_UInt, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp, _Bp, _Tp, _Cp, _Lp, _Fp>& __x, const mersenne_twister_engine<_UInt, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp, @@ -474,7 +474,7 @@ class _UInt, size_t _Wp, size_t _Np, size_t _Mp, size_t _Rp, _UInt _Ap, size_t _Up, _UInt _Dp, size_t _Sp, _UInt _Bp, size_t _Tp, _UInt _Cp, size_t _Lp, _UInt _Fp> -basic_ostream<_CharT, _Traits>& +_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, const mersenne_twister_engine<_UInt, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp, _Bp, _Tp, _Cp, _Lp, _Fp>& __x) @@ -496,7 +496,7 @@ class _UInt, size_t _Wp, size_t _Np, size_t _Mp, size_t _Rp, _UInt _Ap, size_t _Up, _UInt _Dp, size_t _Sp, _UInt _Bp, size_t _Tp, _UInt _Cp, size_t _Lp, _UInt _Fp> -basic_istream<_CharT, _Traits>& +_LIBCPP_HIDE_FROM_ABI basic_istream<_CharT, _Traits>& operator>>(basic_istream<_CharT, _Traits>& __is, mersenne_twister_engine<_UInt, _Wp, _Np, _Mp, _Rp, _Ap, _Up, _Dp, _Sp, _Bp, _Tp, _Cp, _Lp, _Fp>& __x) diff --git a/libcxx/include/__random/negative_binomial_distribution.h b/libcxx/include/__random/negative_binomial_distribution.h --- a/libcxx/include/__random/negative_binomial_distribution.h +++ b/libcxx/include/__random/negative_binomial_distribution.h @@ -144,7 +144,7 @@ } template -basic_ostream<_CharT, _Traits>& +_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, const negative_binomial_distribution<_IntType>& __x) { @@ -158,7 +158,7 @@ } template -basic_istream<_CharT, _Traits>& +_LIBCPP_HIDE_FROM_ABI basic_istream<_CharT, _Traits>& operator>>(basic_istream<_CharT, _Traits>& __is, negative_binomial_distribution<_IntType>& __x) { diff --git a/libcxx/include/__random/normal_distribution.h b/libcxx/include/__random/normal_distribution.h --- a/libcxx/include/__random/normal_distribution.h +++ b/libcxx/include/__random/normal_distribution.h @@ -160,7 +160,7 @@ } template -basic_ostream<_CharT, _Traits>& +_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, const normal_distribution<_RT>& __x) { @@ -177,7 +177,7 @@ } template -basic_istream<_CharT, _Traits>& +_LIBCPP_HIDE_FROM_ABI basic_istream<_CharT, _Traits>& operator>>(basic_istream<_CharT, _Traits>& __is, normal_distribution<_RT>& __x) { diff --git a/libcxx/include/__random/piecewise_constant_distribution.h b/libcxx/include/__random/piecewise_constant_distribution.h --- a/libcxx/include/__random/piecewise_constant_distribution.h +++ b/libcxx/include/__random/piecewise_constant_distribution.h @@ -294,7 +294,7 @@ } template -basic_ostream<_CharT, _Traits>& +_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, const piecewise_constant_distribution<_RT>& __x) { @@ -320,7 +320,7 @@ } template -basic_istream<_CharT, _Traits>& +_LIBCPP_HIDE_FROM_ABI basic_istream<_CharT, _Traits>& operator>>(basic_istream<_CharT, _Traits>& __is, piecewise_constant_distribution<_RT>& __x) { diff --git a/libcxx/include/__random/piecewise_linear_distribution.h b/libcxx/include/__random/piecewise_linear_distribution.h --- a/libcxx/include/__random/piecewise_linear_distribution.h +++ b/libcxx/include/__random/piecewise_linear_distribution.h @@ -310,7 +310,7 @@ } template -basic_ostream<_CharT, _Traits>& +_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, const piecewise_linear_distribution<_RT>& __x) { @@ -336,7 +336,7 @@ } template -basic_istream<_CharT, _Traits>& +_LIBCPP_HIDE_FROM_ABI basic_istream<_CharT, _Traits>& operator>>(basic_istream<_CharT, _Traits>& __is, piecewise_linear_distribution<_RT>& __x) { diff --git a/libcxx/include/__random/poisson_distribution.h b/libcxx/include/__random/poisson_distribution.h --- a/libcxx/include/__random/poisson_distribution.h +++ b/libcxx/include/__random/poisson_distribution.h @@ -245,7 +245,7 @@ } template -basic_ostream<_CharT, _Traits>& +_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, const poisson_distribution<_IntType>& __x) { @@ -257,7 +257,7 @@ } template -basic_istream<_CharT, _Traits>& +_LIBCPP_HIDE_FROM_ABI basic_istream<_CharT, _Traits>& operator>>(basic_istream<_CharT, _Traits>& __is, poisson_distribution<_IntType>& __x) { diff --git a/libcxx/include/__random/shuffle_order_engine.h b/libcxx/include/__random/shuffle_order_engine.h --- a/libcxx/include/__random/shuffle_order_engine.h +++ b/libcxx/include/__random/shuffle_order_engine.h @@ -215,7 +215,7 @@ _LIBCPP_CONSTEXPR const size_t shuffle_order_engine<_Engine, __k>::table_size; template -bool +_LIBCPP_HIDE_FROM_ABI bool operator==( const shuffle_order_engine<_Eng, _Kp>& __x, const shuffle_order_engine<_Eng, _Kp>& __y) @@ -236,7 +236,7 @@ template -basic_ostream<_CharT, _Traits>& +_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, const shuffle_order_engine<_Eng, _Kp>& __x) { @@ -253,7 +253,7 @@ template -basic_istream<_CharT, _Traits>& +_LIBCPP_HIDE_FROM_ABI basic_istream<_CharT, _Traits>& operator>>(basic_istream<_CharT, _Traits>& __is, shuffle_order_engine<_Eng, _Kp>& __x) { diff --git a/libcxx/include/__random/student_t_distribution.h b/libcxx/include/__random/student_t_distribution.h --- a/libcxx/include/__random/student_t_distribution.h +++ b/libcxx/include/__random/student_t_distribution.h @@ -118,7 +118,7 @@ } template -basic_ostream<_CharT, _Traits>& +_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, const student_t_distribution<_RT>& __x) { @@ -131,7 +131,7 @@ } template -basic_istream<_CharT, _Traits>& +_LIBCPP_HIDE_FROM_ABI basic_istream<_CharT, _Traits>& operator>>(basic_istream<_CharT, _Traits>& __is, student_t_distribution<_RT>& __x) { diff --git a/libcxx/include/__random/subtract_with_carry_engine.h b/libcxx/include/__random/subtract_with_carry_engine.h --- a/libcxx/include/__random/subtract_with_carry_engine.h +++ b/libcxx/include/__random/subtract_with_carry_engine.h @@ -33,7 +33,7 @@ class _LIBCPP_TEMPLATE_VIS subtract_with_carry_engine; template -bool +_LIBCPP_HIDE_FROM_ABI bool operator==( const subtract_with_carry_engine<_UInt, _Wp, _Sp, _Rp>& __x, const subtract_with_carry_engine<_UInt, _Wp, _Sp, _Rp>& __y); @@ -47,13 +47,13 @@ template -basic_ostream<_CharT, _Traits>& +_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, const subtract_with_carry_engine<_UInt, _Wp, _Sp, _Rp>& __x); template -basic_istream<_CharT, _Traits>& +_LIBCPP_HIDE_FROM_ABI basic_istream<_CharT, _Traits>& operator>>(basic_istream<_CharT, _Traits>& __is, subtract_with_carry_engine<_UInt, _Wp, _Sp, _Rp>& __x); @@ -251,7 +251,7 @@ } template -bool +_LIBCPP_HIDE_FROM_ABI bool operator==( const subtract_with_carry_engine<_UInt, _Wp, _Sp, _Rp>& __x, const subtract_with_carry_engine<_UInt, _Wp, _Sp, _Rp>& __y) @@ -305,7 +305,7 @@ template -basic_ostream<_CharT, _Traits>& +_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, const subtract_with_carry_engine<_UInt, _Wp, _Sp, _Rp>& __x) { @@ -325,7 +325,7 @@ template -basic_istream<_CharT, _Traits>& +_LIBCPP_HIDE_FROM_ABI basic_istream<_CharT, _Traits>& operator>>(basic_istream<_CharT, _Traits>& __is, subtract_with_carry_engine<_UInt, _Wp, _Sp, _Rp>& __x) { diff --git a/libcxx/include/__random/uniform_int_distribution.h b/libcxx/include/__random/uniform_int_distribution.h --- a/libcxx/include/__random/uniform_int_distribution.h +++ b/libcxx/include/__random/uniform_int_distribution.h @@ -178,8 +178,10 @@ result_type a() const {return __a_;} result_type b() const {return __b_;} + _LIBCPP_HIDE_FROM_ABI friend bool operator==(const param_type& __x, const param_type& __y) {return __x.__a_ == __y.__a_ && __x.__b_ == __y.__b_;} + _LIBCPP_HIDE_FROM_ABI friend bool operator!=(const param_type& __x, const param_type& __y) {return !(__x == __y);} }; @@ -218,9 +220,11 @@ result_type min() const {return a();} result_type max() const {return b();} + _LIBCPP_HIDE_FROM_ABI friend bool operator==(const uniform_int_distribution& __x, const uniform_int_distribution& __y) {return __x.__p_ == __y.__p_;} + _LIBCPP_HIDE_FROM_ABI friend bool operator!=(const uniform_int_distribution& __x, const uniform_int_distribution& __y) {return !(__x == __y);} @@ -255,7 +259,7 @@ } template -basic_ostream<_CharT, _Traits>& +_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, const uniform_int_distribution<_IT>& __x) { @@ -268,7 +272,7 @@ } template -basic_istream<_CharT, _Traits>& +_LIBCPP_HIDE_FROM_ABI basic_istream<_CharT, _Traits>& operator>>(basic_istream<_CharT, _Traits>& __is, uniform_int_distribution<_IT>& __x) { diff --git a/libcxx/include/__random/uniform_real_distribution.h b/libcxx/include/__random/uniform_real_distribution.h --- a/libcxx/include/__random/uniform_real_distribution.h +++ b/libcxx/include/__random/uniform_real_distribution.h @@ -123,7 +123,7 @@ } template -basic_ostream<_CharT, _Traits>& +_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, const uniform_real_distribution<_RT>& __x) { @@ -137,7 +137,7 @@ } template -basic_istream<_CharT, _Traits>& +_LIBCPP_HIDE_FROM_ABI basic_istream<_CharT, _Traits>& operator>>(basic_istream<_CharT, _Traits>& __is, uniform_real_distribution<_RT>& __x) { diff --git a/libcxx/include/__random/weibull_distribution.h b/libcxx/include/__random/weibull_distribution.h --- a/libcxx/include/__random/weibull_distribution.h +++ b/libcxx/include/__random/weibull_distribution.h @@ -115,7 +115,7 @@ }; template -basic_ostream<_CharT, _Traits>& +_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, const weibull_distribution<_RT>& __x) { @@ -130,7 +130,7 @@ } template -basic_istream<_CharT, _Traits>& +_LIBCPP_HIDE_FROM_ABI basic_istream<_CharT, _Traits>& operator>>(basic_istream<_CharT, _Traits>& __is, weibull_distribution<_RT>& __x) { diff --git a/libcxx/include/__ranges/iota_view.h b/libcxx/include/__ranges/iota_view.h --- a/libcxx/include/__ranges/iota_view.h +++ b/libcxx/include/__ranges/iota_view.h @@ -221,6 +221,7 @@ return !(__x < __y); } + _LIBCPP_HIDE_FROM_ABI friend constexpr auto operator<=>(const __iterator& __x, const __iterator& __y) requires totally_ordered<_Start> && three_way_comparable<_Start> { diff --git a/libcxx/include/__string/char_traits.h b/libcxx/include/__string/char_traits.h --- a/libcxx/include/__string/char_traits.h +++ b/libcxx/include/__string/char_traits.h @@ -165,7 +165,7 @@ } template -static inline _LIBCPP_CONSTEXPR_AFTER_CXX17 +_LIBCPP_HIDE_FROM_ABI static inline _LIBCPP_CONSTEXPR_AFTER_CXX17 _CharT* __char_traits_move(_CharT* __dest, const _CharT* __source, size_t __n) _NOEXCEPT { #ifdef _LIBCPP_COMPILER_GCC @@ -713,7 +713,7 @@ } template -inline _LIBCPP_CONSTEXPR_AFTER_CXX11 const _CharT * +_LIBCPP_HIDE_FROM_ABI inline _LIBCPP_CONSTEXPR_AFTER_CXX11 const _CharT * __search_substring(const _CharT *__first1, const _CharT *__last1, const _CharT *__first2, const _CharT *__last2) _NOEXCEPT { // Take advantage of knowing source and pattern lengths. diff --git a/libcxx/include/__tree b/libcxx/include/__tree --- a/libcxx/include/__tree +++ b/libcxx/include/__tree @@ -126,7 +126,7 @@ // __root == nullptr is a proper tree. Returns true is __root is a proper // red black tree, else returns false. template -bool +_LIBCPP_HIDE_FROM_ABI bool __tree_invariant(_NodePtr __root) { if (__root == nullptr) @@ -169,7 +169,7 @@ // Returns: pointer to the next in-order node after __x. template -_NodePtr +_LIBCPP_HIDE_FROM_ABI _NodePtr __tree_next(_NodePtr __x) _NOEXCEPT { _LIBCPP_ASSERT(__x != nullptr, "node shouldn't be null"); @@ -211,7 +211,7 @@ // Returns: pointer to a node which has no children template -_NodePtr +_LIBCPP_HIDE_FROM_ABI _NodePtr __tree_leaf(_NodePtr __x) _NOEXCEPT { _LIBCPP_ASSERT(__x != nullptr, "node shouldn't be null"); @@ -235,7 +235,7 @@ // Effects: Makes __x->__right_ the subtree root with __x as its left child // while preserving in-order order. template -void +_LIBCPP_HIDE_FROM_ABI void __tree_left_rotate(_NodePtr __x) _NOEXCEPT { _LIBCPP_ASSERT(__x != nullptr, "node shouldn't be null"); @@ -256,7 +256,7 @@ // Effects: Makes __x->__left_ the subtree root with __x as its right child // while preserving in-order order. template -void +_LIBCPP_HIDE_FROM_ABI void __tree_right_rotate(_NodePtr __x) _NOEXCEPT { _LIBCPP_ASSERT(__x != nullptr, "node shouldn't be null"); @@ -282,7 +282,7 @@ // Postcondition: __tree_invariant(end_node->__left_) == true. end_node->__left_ // may be different than the value passed in as __root. template -void +_LIBCPP_HIDE_FROM_ABI void __tree_balance_after_insert(_NodePtr __root, _NodePtr __x) _NOEXCEPT { _LIBCPP_ASSERT(__root != nullptr, "Root of the tree shouldn't be null"); @@ -352,7 +352,7 @@ // nor any of its children refer to __z. end_node->__left_ // may be different than the value passed in as __root. template -void +_LIBCPP_HIDE_FROM_ABI void __tree_remove(_NodePtr __root, _NodePtr __z) _NOEXCEPT { _LIBCPP_ASSERT(__root != nullptr, "Root node should not be null"); diff --git a/libcxx/include/__type_traits/is_constant_evaluated.h b/libcxx/include/__type_traits/is_constant_evaluated.h --- a/libcxx/include/__type_traits/is_constant_evaluated.h +++ b/libcxx/include/__type_traits/is_constant_evaluated.h @@ -24,7 +24,7 @@ } #endif -inline _LIBCPP_CONSTEXPR +_LIBCPP_HIDE_FROM_ABI inline _LIBCPP_CONSTEXPR bool __libcpp_is_constant_evaluated() _NOEXCEPT { return __builtin_is_constant_evaluated(); } _LIBCPP_END_NAMESPACE_STD diff --git a/libcxx/include/__utility/as_const.h b/libcxx/include/__utility/as_const.h --- a/libcxx/include/__utility/as_const.h +++ b/libcxx/include/__utility/as_const.h @@ -22,7 +22,7 @@ #if _LIBCPP_STD_VER > 14 template -_LIBCPP_NODISCARD_EXT constexpr add_const_t<_Tp>& as_const(_Tp& __t) noexcept { return __t; } +_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr add_const_t<_Tp>& as_const(_Tp& __t) noexcept { return __t; } template void as_const(const _Tp&&) = delete; diff --git a/libcxx/include/bitset b/libcxx/include/bitset --- a/libcxx/include/bitset +++ b/libcxx/include/bitset @@ -1098,11 +1098,11 @@ }; template -basic_istream<_CharT, _Traits>& +_LIBCPP_HIDE_FROM_ABI basic_istream<_CharT, _Traits>& operator>>(basic_istream<_CharT, _Traits>& __is, bitset<_Size>& __x); template -basic_ostream<_CharT, _Traits>& +_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, const bitset<_Size>& __x); _LIBCPP_END_NAMESPACE_STD diff --git a/libcxx/include/cmath b/libcxx/include/cmath --- a/libcxx/include/cmath +++ b/libcxx/include/cmath @@ -615,7 +615,7 @@ #if _LIBCPP_STD_VER > 17 template -constexpr +_LIBCPP_HIDE_FROM_ABI constexpr _Fp __lerp(_Fp __a, _Fp __b, _Fp __t) noexcept { if ((__a <= 0 && __b >= 0) || (__a >= 0 && __b <= 0)) return __t * __b + (1 - __t) * __a; @@ -628,13 +628,13 @@ return __x < __b ? __x : __b; } -constexpr float +_LIBCPP_HIDE_FROM_ABI constexpr float lerp(float __a, float __b, float __t) _NOEXCEPT { return __lerp(__a, __b, __t); } -constexpr double +_LIBCPP_HIDE_FROM_ABI constexpr double lerp(double __a, double __b, double __t) _NOEXCEPT { return __lerp(__a, __b, __t); } -constexpr long double +_LIBCPP_HIDE_FROM_ABI constexpr long double lerp(long double __a, long double __b, long double __t) _NOEXCEPT { return __lerp(__a, __b, __t); } template diff --git a/libcxx/include/complex b/libcxx/include/complex --- a/libcxx/include/complex +++ b/libcxx/include/complex @@ -251,8 +251,8 @@ template class _LIBCPP_TEMPLATE_VIS complex; -template complex<_Tp> operator*(const complex<_Tp>& __z, const complex<_Tp>& __w); -template complex<_Tp> operator/(const complex<_Tp>& __x, const complex<_Tp>& __y); +template _LIBCPP_HIDE_FROM_ABI complex<_Tp> operator*(const complex<_Tp>& __z, const complex<_Tp>& __w); +template _LIBCPP_HIDE_FROM_ABI complex<_Tp> operator/(const complex<_Tp>& __x, const complex<_Tp>& __y); template class _LIBCPP_TEMPLATE_VIS complex @@ -583,7 +583,7 @@ } template -complex<_Tp> +_LIBCPP_HIDE_FROM_ABI complex<_Tp> operator*(const complex<_Tp>& __z, const complex<_Tp>& __w) { _Tp __a = __z.real(); @@ -662,7 +662,7 @@ } template -complex<_Tp> +_LIBCPP_HIDE_FROM_ABI complex<_Tp> operator/(const complex<_Tp>& __z, const complex<_Tp>& __w) { int __ilogbw = 0; @@ -987,7 +987,7 @@ // polar template -complex<_Tp> +_LIBCPP_HIDE_FROM_ABI complex<_Tp> polar(const _Tp& __rho, const _Tp& __theta = _Tp()) { if (__libcpp_isnan_or_builtin(__rho) || signbit(__rho)) @@ -1036,7 +1036,7 @@ // sqrt template -complex<_Tp> +_LIBCPP_HIDE_FROM_ABI complex<_Tp> sqrt(const complex<_Tp>& __x) { if (__libcpp_isinf_or_builtin(__x.imag())) @@ -1053,7 +1053,7 @@ // exp template -complex<_Tp> +_LIBCPP_HIDE_FROM_ABI complex<_Tp> exp(const complex<_Tp>& __x) { _Tp __i = __x.imag(); @@ -1137,7 +1137,7 @@ // asinh template -complex<_Tp> +_LIBCPP_HIDE_FROM_ABI complex<_Tp> asinh(const complex<_Tp>& __x) { const _Tp __pi(atan2(+0., -0.)); @@ -1166,7 +1166,7 @@ // acosh template -complex<_Tp> +_LIBCPP_HIDE_FROM_ABI complex<_Tp> acosh(const complex<_Tp>& __x) { const _Tp __pi(atan2(+0., -0.)); @@ -1200,7 +1200,7 @@ // atanh template -complex<_Tp> +_LIBCPP_HIDE_FROM_ABI complex<_Tp> atanh(const complex<_Tp>& __x) { const _Tp __pi(atan2(+0., -0.)); @@ -1233,7 +1233,7 @@ // sinh template -complex<_Tp> +_LIBCPP_HIDE_FROM_ABI complex<_Tp> sinh(const complex<_Tp>& __x) { if (__libcpp_isinf_or_builtin(__x.real()) && !__libcpp_isfinite_or_builtin(__x.imag())) @@ -1248,7 +1248,7 @@ // cosh template -complex<_Tp> +_LIBCPP_HIDE_FROM_ABI complex<_Tp> cosh(const complex<_Tp>& __x) { if (__libcpp_isinf_or_builtin(__x.real()) && !__libcpp_isfinite_or_builtin(__x.imag())) @@ -1265,7 +1265,7 @@ // tanh template -complex<_Tp> +_LIBCPP_HIDE_FROM_ABI complex<_Tp> tanh(const complex<_Tp>& __x) { if (__libcpp_isinf_or_builtin(__x.real())) @@ -1289,7 +1289,7 @@ // asin template -complex<_Tp> +_LIBCPP_HIDE_FROM_ABI complex<_Tp> asin(const complex<_Tp>& __x) { complex<_Tp> __z = asinh(complex<_Tp>(-__x.imag(), __x.real())); @@ -1299,7 +1299,7 @@ // acos template -complex<_Tp> +_LIBCPP_HIDE_FROM_ABI complex<_Tp> acos(const complex<_Tp>& __x) { const _Tp __pi(atan2(+0., -0.)); @@ -1336,7 +1336,7 @@ // atan template -complex<_Tp> +_LIBCPP_HIDE_FROM_ABI complex<_Tp> atan(const complex<_Tp>& __x) { complex<_Tp> __z = atanh(complex<_Tp>(-__x.imag(), __x.real())); @@ -1346,7 +1346,7 @@ // sin template -complex<_Tp> +_LIBCPP_HIDE_FROM_ABI complex<_Tp> sin(const complex<_Tp>& __x) { complex<_Tp> __z = sinh(complex<_Tp>(-__x.imag(), __x.real())); @@ -1366,7 +1366,7 @@ // tan template -complex<_Tp> +_LIBCPP_HIDE_FROM_ABI complex<_Tp> tan(const complex<_Tp>& __x) { complex<_Tp> __z = tanh(complex<_Tp>(-__x.imag(), __x.real())); @@ -1374,7 +1374,7 @@ } template -basic_istream<_CharT, _Traits>& +_LIBCPP_HIDE_FROM_ABI basic_istream<_CharT, _Traits>& operator>>(basic_istream<_CharT, _Traits>& __is, complex<_Tp>& __x) { if (__is.good()) @@ -1437,7 +1437,7 @@ #if !defined(_LIBCPP_HAS_NO_LOCALIZATION) template -basic_ostream<_CharT, _Traits>& +_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, const complex<_Tp>& __x) { basic_ostringstream<_CharT, _Traits> __s; @@ -1455,34 +1455,34 @@ { inline namespace complex_literals { - constexpr complex operator""il(long double __im) + _LIBCPP_HIDE_FROM_ABI constexpr complex operator""il(long double __im) { return { 0.0l, __im }; } - constexpr complex operator""il(unsigned long long __im) + _LIBCPP_HIDE_FROM_ABI constexpr complex operator""il(unsigned long long __im) { return { 0.0l, static_cast(__im) }; } - constexpr complex operator""i(long double __im) + _LIBCPP_HIDE_FROM_ABI constexpr complex operator""i(long double __im) { return { 0.0, static_cast(__im) }; } - constexpr complex operator""i(unsigned long long __im) + _LIBCPP_HIDE_FROM_ABI constexpr complex operator""i(unsigned long long __im) { return { 0.0, static_cast(__im) }; } - constexpr complex operator""if(long double __im) + _LIBCPP_HIDE_FROM_ABI constexpr complex operator""if(long double __im) { return { 0.0f, static_cast(__im) }; } - constexpr complex operator""if(unsigned long long __im) + _LIBCPP_HIDE_FROM_ABI constexpr complex operator""if(unsigned long long __im) { return { 0.0f, static_cast(__im) }; } diff --git a/libcxx/include/cstddef b/libcxx/include/cstddef --- a/libcxx/include/cstddef +++ b/libcxx/include/cstddef @@ -62,7 +62,7 @@ { enum class byte : unsigned char {}; -constexpr byte operator| (byte __lhs, byte __rhs) noexcept +_LIBCPP_HIDE_FROM_ABI constexpr byte operator| (byte __lhs, byte __rhs) noexcept { return static_cast( static_cast( @@ -70,10 +70,10 @@ )); } -constexpr byte& operator|=(byte& __lhs, byte __rhs) noexcept +_LIBCPP_HIDE_FROM_ABI constexpr byte& operator|=(byte& __lhs, byte __rhs) noexcept { return __lhs = __lhs | __rhs; } -constexpr byte operator& (byte __lhs, byte __rhs) noexcept +_LIBCPP_HIDE_FROM_ABI constexpr byte operator& (byte __lhs, byte __rhs) noexcept { return static_cast( static_cast( @@ -81,10 +81,10 @@ )); } -constexpr byte& operator&=(byte& __lhs, byte __rhs) noexcept +_LIBCPP_HIDE_FROM_ABI constexpr byte& operator&=(byte& __lhs, byte __rhs) noexcept { return __lhs = __lhs & __rhs; } -constexpr byte operator^ (byte __lhs, byte __rhs) noexcept +_LIBCPP_HIDE_FROM_ABI constexpr byte operator^ (byte __lhs, byte __rhs) noexcept { return static_cast( static_cast( @@ -92,10 +92,10 @@ )); } -constexpr byte& operator^=(byte& __lhs, byte __rhs) noexcept +_LIBCPP_HIDE_FROM_ABI constexpr byte& operator^=(byte& __lhs, byte __rhs) noexcept { return __lhs = __lhs ^ __rhs; } -constexpr byte operator~ (byte __b) noexcept +_LIBCPP_HIDE_FROM_ABI constexpr byte operator~ (byte __b) noexcept { return static_cast( static_cast( @@ -107,27 +107,27 @@ using _EnableByteOverload = __enable_if_t::value, byte>; template - constexpr _EnableByteOverload<_Integer> & +_LIBCPP_HIDE_FROM_ABI constexpr _EnableByteOverload<_Integer> & operator<<=(byte& __lhs, _Integer __shift) noexcept { return __lhs = __lhs << __shift; } template - constexpr _EnableByteOverload<_Integer> +_LIBCPP_HIDE_FROM_ABI constexpr _EnableByteOverload<_Integer> operator<< (byte __lhs, _Integer __shift) noexcept { return static_cast(static_cast(static_cast(__lhs) << __shift)); } template - constexpr _EnableByteOverload<_Integer> & +_LIBCPP_HIDE_FROM_ABI constexpr _EnableByteOverload<_Integer> & operator>>=(byte& __lhs, _Integer __shift) noexcept { return __lhs = __lhs >> __shift; } template - constexpr _EnableByteOverload<_Integer> +_LIBCPP_HIDE_FROM_ABI constexpr _EnableByteOverload<_Integer> operator>> (byte __lhs, _Integer __shift) noexcept { return static_cast(static_cast(static_cast(__lhs) >> __shift)); } template > - _LIBCPP_NODISCARD_EXT constexpr _Integer +_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI constexpr _Integer to_integer(byte __b) noexcept { return static_cast<_Integer>(__b); } } // namespace std diff --git a/libcxx/include/deque b/libcxx/include/deque --- a/libcxx/include/deque +++ b/libcxx/include/deque @@ -223,7 +223,7 @@ template -__deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2> +_LIBCPP_HIDE_FROM_ABI __deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2> copy(_RAIter __f, _RAIter __l, __deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2> __r, @@ -231,21 +231,21 @@ template -_OutputIterator +_LIBCPP_HIDE_FROM_ABI _OutputIterator copy(__deque_iterator<_V1, _P1, _R1, _M1, _D1, _B1> __f, __deque_iterator<_V1, _P1, _R1, _M1, _D1, _B1> __l, _OutputIterator __r); template -__deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2> +_LIBCPP_HIDE_FROM_ABI __deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2> copy(__deque_iterator<_V1, _P1, _R1, _M1, _D1, _B1> __f, __deque_iterator<_V1, _P1, _R1, _M1, _D1, _B1> __l, __deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2> __r); template -__deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2> +_LIBCPP_HIDE_FROM_ABI __deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2> copy_backward(_RAIter __f, _RAIter __l, __deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2> __r, @@ -253,21 +253,21 @@ template -_OutputIterator +_LIBCPP_HIDE_FROM_ABI _OutputIterator copy_backward(__deque_iterator<_V1, _P1, _R1, _M1, _D1, _B1> __f, __deque_iterator<_V1, _P1, _R1, _M1, _D1, _B1> __l, _OutputIterator __r); template -__deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2> +_LIBCPP_HIDE_FROM_ABI __deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2> copy_backward(__deque_iterator<_V1, _P1, _R1, _M1, _D1, _B1> __f, __deque_iterator<_V1, _P1, _R1, _M1, _D1, _B1> __l, __deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2> __r); template -__deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2> +_LIBCPP_HIDE_FROM_ABI __deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2> move(_RAIter __f, _RAIter __l, __deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2> __r, @@ -275,21 +275,21 @@ template -_OutputIterator +_LIBCPP_HIDE_FROM_ABI _OutputIterator move(__deque_iterator<_V1, _P1, _R1, _M1, _D1, _B1> __f, __deque_iterator<_V1, _P1, _R1, _M1, _D1, _B1> __l, _OutputIterator __r); template -__deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2> +_LIBCPP_HIDE_FROM_ABI __deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2> move(__deque_iterator<_V1, _P1, _R1, _M1, _D1, _B1> __f, __deque_iterator<_V1, _P1, _R1, _M1, _D1, _B1> __l, __deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2> __r); template -__deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2> +_LIBCPP_HIDE_FROM_ABI __deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2> move_backward(_RAIter __f, _RAIter __l, __deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2> __r, @@ -297,14 +297,14 @@ template -_OutputIterator +_LIBCPP_HIDE_FROM_ABI _OutputIterator move_backward(__deque_iterator<_V1, _P1, _R1, _M1, _D1, _B1> __f, __deque_iterator<_V1, _P1, _R1, _M1, _D1, _B1> __l, _OutputIterator __r); template -__deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2> +_LIBCPP_HIDE_FROM_ABI __deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2> move_backward(__deque_iterator<_V1, _P1, _R1, _M1, _D1, _B1> __f, __deque_iterator<_V1, _P1, _R1, _M1, _D1, _B1> __l, __deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2> __r); @@ -591,7 +591,7 @@ template -__deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2> +_LIBCPP_HIDE_FROM_ABI __deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2> copy(_RAIter __f, _RAIter __l, __deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2> __r, @@ -621,7 +621,7 @@ template -_OutputIterator +_LIBCPP_HIDE_FROM_ABI _OutputIterator copy(__deque_iterator<_V1, _P1, _R1, _M1, _D1, _B1> __f, __deque_iterator<_V1, _P1, _R1, _M1, _D1, _B1> __l, _OutputIterator __r) @@ -649,7 +649,7 @@ template -__deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2> +_LIBCPP_HIDE_FROM_ABI __deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2> copy(__deque_iterator<_V1, _P1, _R1, _M1, _D1, _B1> __f, __deque_iterator<_V1, _P1, _R1, _M1, _D1, _B1> __l, __deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2> __r) @@ -679,7 +679,7 @@ template -__deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2> +_LIBCPP_HIDE_FROM_ABI __deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2> copy_backward(_RAIter __f, _RAIter __l, __deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2> __r, @@ -709,7 +709,7 @@ template -_OutputIterator +_LIBCPP_HIDE_FROM_ABI _OutputIterator copy_backward(__deque_iterator<_V1, _P1, _R1, _M1, _D1, _B1> __f, __deque_iterator<_V1, _P1, _R1, _M1, _D1, _B1> __l, _OutputIterator __r) @@ -737,7 +737,7 @@ template -__deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2> +_LIBCPP_HIDE_FROM_ABI __deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2> copy_backward(__deque_iterator<_V1, _P1, _R1, _M1, _D1, _B1> __f, __deque_iterator<_V1, _P1, _R1, _M1, _D1, _B1> __l, __deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2> __r) @@ -767,7 +767,7 @@ template -__deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2> +_LIBCPP_HIDE_FROM_ABI __deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2> move(_RAIter __f, _RAIter __l, __deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2> __r, @@ -797,7 +797,7 @@ template -_OutputIterator +_LIBCPP_HIDE_FROM_ABI _OutputIterator move(__deque_iterator<_V1, _P1, _R1, _M1, _D1, _B1> __f, __deque_iterator<_V1, _P1, _R1, _M1, _D1, _B1> __l, _OutputIterator __r) @@ -825,7 +825,7 @@ template -__deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2> +_LIBCPP_HIDE_FROM_ABI __deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2> move(__deque_iterator<_V1, _P1, _R1, _M1, _D1, _B1> __f, __deque_iterator<_V1, _P1, _R1, _M1, _D1, _B1> __l, __deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2> __r) @@ -855,7 +855,7 @@ template -__deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2> +_LIBCPP_HIDE_FROM_ABI __deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2> move_backward(_RAIter __f, _RAIter __l, __deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2> __r, @@ -885,7 +885,7 @@ template -_OutputIterator +_LIBCPP_HIDE_FROM_ABI _OutputIterator move_backward(__deque_iterator<_V1, _P1, _R1, _M1, _D1, _B1> __f, __deque_iterator<_V1, _P1, _R1, _M1, _D1, _B1> __l, _OutputIterator __r) @@ -913,7 +913,7 @@ template -__deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2> +_LIBCPP_HIDE_FROM_ABI __deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2> move_backward(__deque_iterator<_V1, _P1, _R1, _M1, _D1, _B1> __f, __deque_iterator<_V1, _P1, _R1, _M1, _D1, _B1> __l, __deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2> __r) @@ -1012,10 +1012,10 @@ } - friend bool operator==(__deque_range const& __lhs, __deque_range const& __rhs) { + _LIBCPP_HIDE_FROM_ABI friend bool operator==(__deque_range const& __lhs, __deque_range const& __rhs) { return __lhs.__pos_ == __rhs.__pos_; } - friend bool operator!=(__deque_range const& __lhs, __deque_range const& __rhs) { + _LIBCPP_HIDE_FROM_ABI friend bool operator!=(__deque_range const& __lhs, __deque_range const& __rhs) { return !(__lhs == __rhs); } }; diff --git a/libcxx/include/exception b/libcxx/include/exception --- a/libcxx/include/exception +++ b/libcxx/include/exception @@ -282,7 +282,7 @@ #endif template -_LIBCPP_NORETURN +_LIBCPP_NORETURN _LIBCPP_HIDE_FROM_ABI void throw_with_nested(_Tp&& __t) { diff --git a/libcxx/include/experimental/iterator b/libcxx/include/experimental/iterator --- a/libcxx/include/experimental/iterator +++ b/libcxx/include/experimental/iterator @@ -110,7 +110,7 @@ template -ostream_joiner::type, _CharT, _Traits> +_LIBCPP_HIDE_FROM_ABI ostream_joiner::type, _CharT, _Traits> make_ostream_joiner(basic_ostream<_CharT, _Traits>& __os, _Delim && __d) { return ostream_joiner::type, _CharT, _Traits>(__os, _VSTD::forward<_Delim>(__d)); } diff --git a/libcxx/include/experimental/simd b/libcxx/include/experimental/simd --- a/libcxx/include/experimental/simd +++ b/libcxx/include/experimental/simd @@ -720,12 +720,12 @@ #ifndef _LIBCPP_HAS_NO_VECTOR_EXTENSION -constexpr size_t __floor_pow_of_2(size_t __val) { +_LIBCPP_HIDE_FROM_ABI constexpr size_t __floor_pow_of_2(size_t __val) { return ((__val - 1) & __val) == 0 ? __val : __floor_pow_of_2((__val - 1) & __val); } -constexpr size_t __ceil_pow_of_2(size_t __val) { +_LIBCPP_HIDE_FROM_ABI constexpr size_t __ceil_pow_of_2(size_t __val) { return __val == 1 ? 1 : __floor_pow_of_2(__val - 1) << 1; } @@ -913,17 +913,18 @@ }; template -constexpr decltype(_To{std::declval<_From>()}, true) +_LIBCPP_HIDE_FROM_ABI constexpr decltype(_To{std::declval<_From>()}, true) __is_non_narrowing_convertible_impl(_From) { return true; } template -constexpr bool __is_non_narrowing_convertible_impl(...) { +_LIBCPP_HIDE_FROM_ABI constexpr bool __is_non_narrowing_convertible_impl(...) { return false; } template +_LIBCPP_HIDE_FROM_ABI constexpr typename std::enable_if::value && std::is_arithmetic<_From>::value, bool>::type @@ -932,6 +933,7 @@ } template +_LIBCPP_HIDE_FROM_ABI constexpr typename std::enable_if::value && std::is_arithmetic<_From>::value), bool>::type @@ -940,12 +942,12 @@ } template -constexpr _Tp __variadic_sum() { +_LIBCPP_HIDE_FROM_ABI constexpr _Tp __variadic_sum() { return _Tp{}; } template -constexpr _Tp __variadic_sum(_Up __first, _Args... __rest) { +_LIBCPP_HIDE_FROM_ABI constexpr _Tp __variadic_sum(_Up __first, _Args... __rest) { return static_cast<_Tp>(__first) + __variadic_sum<_Tp>(__rest...); } @@ -955,7 +957,7 @@ }; template -constexpr bool __vectorizable() { +_LIBCPP_HIDE_FROM_ABI constexpr bool __vectorizable() { return std::is_arithmetic<_Tp>::value && !std::is_const<_Tp>::value && !std::is_volatile<_Tp>::value && !std::is_same<_Tp, bool>::value; } @@ -1123,13 +1125,13 @@ }; template -auto simd_cast(const simd<_Up, _Abi>& __v) +_LIBCPP_HIDE_FROM_ABI auto simd_cast(const simd<_Up, _Abi>& __v) -> decltype(__simd_cast_traits<_Tp>::__apply(__v)) { return __simd_cast_traits<_Tp>::__apply(__v); } template -auto static_simd_cast(const simd<_Up, _Abi>& __v) +_LIBCPP_HIDE_FROM_ABI auto static_simd_cast(const simd<_Up, _Abi>& __v) -> decltype(__static_simd_cast_traits<_Tp>::__apply(__v)) { return __static_simd_cast_traits<_Tp>::__apply(__v); } diff --git a/libcxx/include/ext/hash_map b/libcxx/include/ext/hash_map --- a/libcxx/include/ext/hash_map +++ b/libcxx/include/ext/hash_map @@ -714,7 +714,7 @@ } template -bool +_LIBCPP_HIDE_FROM_ABI bool operator==(const hash_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x, const hash_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __y) { @@ -954,7 +954,7 @@ } template -bool +_LIBCPP_HIDE_FROM_ABI bool operator==(const hash_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x, const hash_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __y) { diff --git a/libcxx/include/ext/hash_set b/libcxx/include/ext/hash_set --- a/libcxx/include/ext/hash_set +++ b/libcxx/include/ext/hash_set @@ -412,7 +412,7 @@ } template -bool +_LIBCPP_HIDE_FROM_ABI bool operator==(const hash_set<_Value, _Hash, _Pred, _Alloc>& __x, const hash_set<_Value, _Hash, _Pred, _Alloc>& __y) { @@ -633,7 +633,7 @@ } template -bool +_LIBCPP_HIDE_FROM_ABI bool operator==(const hash_multiset<_Value, _Hash, _Pred, _Alloc>& __x, const hash_multiset<_Value, _Hash, _Pred, _Alloc>& __y) { diff --git a/libcxx/include/forward_list b/libcxx/include/forward_list --- a/libcxx/include/forward_list +++ b/libcxx/include/forward_list @@ -1702,6 +1702,7 @@ } template +_LIBCPP_HIDE_FROM_ABI bool operator==(const forward_list<_Tp, _Alloc>& __x, const forward_list<_Tp, _Alloc>& __y) { diff --git a/libcxx/include/future b/libcxx/include/future --- a/libcxx/include/future +++ b/libcxx/include/future @@ -2174,7 +2174,7 @@ { return (int(__policy) & int(__value)) != 0; } template -_LIBCPP_NODISCARD_AFTER_CXX17 +_LIBCPP_NODISCARD_AFTER_CXX17 _LIBCPP_HIDE_FROM_ABI future::type, typename decay<_Args>::type...>::type> async(launch __policy, _Fp&& __f, _Args&&... __args) { diff --git a/libcxx/include/iomanip b/libcxx/include/iomanip --- a/libcxx/include/iomanip +++ b/libcxx/include/iomanip @@ -278,7 +278,7 @@ template class __iom_t7; template -basic_istream<_CharT, _Traits>& +_LIBCPP_HIDE_FROM_ABI basic_istream<_CharT, _Traits>& operator>>(basic_istream<_CharT, _Traits>& __is, const __iom_t7<_MoneyT>& __x); template @@ -298,7 +298,7 @@ }; template -basic_istream<_CharT, _Traits>& +_LIBCPP_HIDE_FROM_ABI basic_istream<_CharT, _Traits>& operator>>(basic_istream<_CharT, _Traits>& __is, const __iom_t7<_MoneyT>& __x) { #ifndef _LIBCPP_NO_EXCEPTIONS @@ -338,7 +338,7 @@ template class __iom_t8; template -basic_ostream<_CharT, _Traits>& +_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, const __iom_t8<_MoneyT>& __x); template @@ -358,7 +358,7 @@ }; template -basic_ostream<_CharT, _Traits>& +_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, const __iom_t8<_MoneyT>& __x) { #ifndef _LIBCPP_NO_EXCEPTIONS @@ -397,7 +397,7 @@ template class __iom_t9; template -basic_istream<_CharT, _Traits>& +_LIBCPP_HIDE_FROM_ABI basic_istream<_CharT, _Traits>& operator>>(basic_istream<_CharT, _Traits>& __is, const __iom_t9<_CharT>& __x); template @@ -417,7 +417,7 @@ }; template -basic_istream<_CharT, _Traits>& +_LIBCPP_HIDE_FROM_ABI basic_istream<_CharT, _Traits>& operator>>(basic_istream<_CharT, _Traits>& __is, const __iom_t9<_CharT>& __x) { #ifndef _LIBCPP_NO_EXCEPTIONS @@ -458,7 +458,7 @@ template class __iom_t10; template -basic_ostream<_CharT, _Traits>& +_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, const __iom_t10<_CharT>& __x); template @@ -478,7 +478,7 @@ }; template -basic_ostream<_CharT, _Traits>& +_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, const __iom_t10<_CharT>& __x) { #ifndef _LIBCPP_NO_EXCEPTIONS diff --git a/libcxx/include/ios b/libcxx/include/ios --- a/libcxx/include/ios +++ b/libcxx/include/ios @@ -842,7 +842,7 @@ ios_base::set_rdbuf(__sb); } -inline +_LIBCPP_HIDE_FROM_ABI inline ios_base& boolalpha(ios_base& __str) { @@ -850,7 +850,7 @@ return __str; } -inline +_LIBCPP_HIDE_FROM_ABI inline ios_base& noboolalpha(ios_base& __str) { @@ -858,7 +858,7 @@ return __str; } -inline +_LIBCPP_HIDE_FROM_ABI inline ios_base& showbase(ios_base& __str) { @@ -866,7 +866,7 @@ return __str; } -inline +_LIBCPP_HIDE_FROM_ABI inline ios_base& noshowbase(ios_base& __str) { @@ -874,7 +874,7 @@ return __str; } -inline +_LIBCPP_HIDE_FROM_ABI inline ios_base& showpoint(ios_base& __str) { @@ -882,7 +882,7 @@ return __str; } -inline +_LIBCPP_HIDE_FROM_ABI inline ios_base& noshowpoint(ios_base& __str) { @@ -890,7 +890,7 @@ return __str; } -inline +_LIBCPP_HIDE_FROM_ABI inline ios_base& showpos(ios_base& __str) { @@ -898,7 +898,7 @@ return __str; } -inline +_LIBCPP_HIDE_FROM_ABI inline ios_base& noshowpos(ios_base& __str) { @@ -906,7 +906,7 @@ return __str; } -inline +_LIBCPP_HIDE_FROM_ABI inline ios_base& skipws(ios_base& __str) { @@ -914,7 +914,7 @@ return __str; } -inline +_LIBCPP_HIDE_FROM_ABI inline ios_base& noskipws(ios_base& __str) { @@ -922,7 +922,7 @@ return __str; } -inline +_LIBCPP_HIDE_FROM_ABI inline ios_base& uppercase(ios_base& __str) { @@ -930,7 +930,7 @@ return __str; } -inline +_LIBCPP_HIDE_FROM_ABI inline ios_base& nouppercase(ios_base& __str) { @@ -938,7 +938,7 @@ return __str; } -inline +_LIBCPP_HIDE_FROM_ABI inline ios_base& unitbuf(ios_base& __str) { @@ -946,7 +946,7 @@ return __str; } -inline +_LIBCPP_HIDE_FROM_ABI inline ios_base& nounitbuf(ios_base& __str) { @@ -954,7 +954,7 @@ return __str; } -inline +_LIBCPP_HIDE_FROM_ABI inline ios_base& internal(ios_base& __str) { @@ -962,7 +962,7 @@ return __str; } -inline +_LIBCPP_HIDE_FROM_ABI inline ios_base& left(ios_base& __str) { @@ -970,7 +970,7 @@ return __str; } -inline +_LIBCPP_HIDE_FROM_ABI inline ios_base& right(ios_base& __str) { @@ -978,7 +978,7 @@ return __str; } -inline +_LIBCPP_HIDE_FROM_ABI inline ios_base& dec(ios_base& __str) { @@ -986,7 +986,7 @@ return __str; } -inline +_LIBCPP_HIDE_FROM_ABI inline ios_base& hex(ios_base& __str) { @@ -994,7 +994,7 @@ return __str; } -inline +_LIBCPP_HIDE_FROM_ABI inline ios_base& oct(ios_base& __str) { @@ -1002,7 +1002,7 @@ return __str; } -inline +_LIBCPP_HIDE_FROM_ABI inline ios_base& fixed(ios_base& __str) { @@ -1010,7 +1010,7 @@ return __str; } -inline +_LIBCPP_HIDE_FROM_ABI inline ios_base& scientific(ios_base& __str) { @@ -1018,7 +1018,7 @@ return __str; } -inline +_LIBCPP_HIDE_FROM_ABI inline ios_base& hexfloat(ios_base& __str) { @@ -1026,7 +1026,7 @@ return __str; } -inline +_LIBCPP_HIDE_FROM_ABI inline ios_base& defaultfloat(ios_base& __str) { diff --git a/libcxx/include/istream b/libcxx/include/istream --- a/libcxx/include/istream +++ b/libcxx/include/istream @@ -633,7 +633,7 @@ #endif // _LIBCPP_STD_VER > 17 template -basic_istream<_CharT, _Traits>& +_LIBCPP_HIDE_FROM_ABI basic_istream<_CharT, _Traits>& operator>>(basic_istream<_CharT, _Traits>& __is, _CharT& __c) { ios_base::iostate __state = ios_base::goodbit; @@ -1329,7 +1329,7 @@ } template -basic_istream<_CharT, _Traits>& +_LIBCPP_HIDE_FROM_ABI basic_istream<_CharT, _Traits>& ws(basic_istream<_CharT, _Traits>& __is) { ios_base::iostate __state = ios_base::goodbit; @@ -1442,7 +1442,7 @@ } template -basic_istream<_CharT, _Traits>& +_LIBCPP_HIDE_FROM_ABI basic_istream<_CharT, _Traits>& operator>>(basic_istream<_CharT, _Traits>& __is, basic_string<_CharT, _Traits, _Allocator>& __str) { @@ -1498,7 +1498,7 @@ } template -basic_istream<_CharT, _Traits>& +_LIBCPP_HIDE_FROM_ABI basic_istream<_CharT, _Traits>& getline(basic_istream<_CharT, _Traits>& __is, basic_string<_CharT, _Traits, _Allocator>& __str, _CharT __dlm) { @@ -1578,7 +1578,7 @@ } template -basic_istream<_CharT, _Traits>& +_LIBCPP_HIDE_FROM_ABI basic_istream<_CharT, _Traits>& operator>>(basic_istream<_CharT, _Traits>& __is, bitset<_Size>& __x) { ios_base::iostate __state = ios_base::goodbit; diff --git a/libcxx/include/mutex b/libcxx/include/mutex --- a/libcxx/include/mutex +++ b/libcxx/include/mutex @@ -329,7 +329,7 @@ } template -int +_LIBCPP_HIDE_FROM_ABI int try_lock(_L0& __l0, _L1& __l1) { unique_lock<_L0> __u0(__l0, try_to_lock); @@ -349,7 +349,7 @@ #ifndef _LIBCPP_CXX03_LANG template -int +_LIBCPP_HIDE_FROM_ABI int try_lock(_L0& __l0, _L1& __l1, _L2& __l2, _L3&... __l3) { int __r = 0; @@ -368,7 +368,7 @@ #endif // _LIBCPP_CXX03_LANG template -void +_LIBCPP_HIDE_FROM_ABI void lock(_L0& __l0, _L1& __l1) { while (true) diff --git a/libcxx/include/ostream b/libcxx/include/ostream --- a/libcxx/include/ostream +++ b/libcxx/include/ostream @@ -748,7 +748,7 @@ } template -basic_ostream<_CharT, _Traits>& +_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>& __put_character_sequence(basic_ostream<_CharT, _Traits>& __os, const _CharT* __str, size_t __len) { @@ -782,14 +782,14 @@ template -basic_ostream<_CharT, _Traits>& +_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, _CharT __c) { return _VSTD::__put_character_sequence(__os, &__c, 1); } template -basic_ostream<_CharT, _Traits>& +_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, char __cn) { #ifndef _LIBCPP_NO_EXCEPTIONS @@ -822,35 +822,35 @@ } template -basic_ostream& +_LIBCPP_HIDE_FROM_ABI basic_ostream& operator<<(basic_ostream& __os, char __c) { return _VSTD::__put_character_sequence(__os, &__c, 1); } template -basic_ostream& +_LIBCPP_HIDE_FROM_ABI basic_ostream& operator<<(basic_ostream& __os, signed char __c) { return _VSTD::__put_character_sequence(__os, (char *) &__c, 1); } template -basic_ostream& +_LIBCPP_HIDE_FROM_ABI basic_ostream& operator<<(basic_ostream& __os, unsigned char __c) { return _VSTD::__put_character_sequence(__os, (char *) &__c, 1); } template -basic_ostream<_CharT, _Traits>& +_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, const _CharT* __str) { return _VSTD::__put_character_sequence(__os, __str, _Traits::length(__str)); } template -basic_ostream<_CharT, _Traits>& +_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, const char* __strn) { #ifndef _LIBCPP_NO_EXCEPTIONS @@ -896,14 +896,14 @@ } template -basic_ostream& +_LIBCPP_HIDE_FROM_ABI basic_ostream& operator<<(basic_ostream& __os, const char* __str) { return _VSTD::__put_character_sequence(__os, __str, _Traits::length(__str)); } template -basic_ostream& +_LIBCPP_HIDE_FROM_ABI basic_ostream& operator<<(basic_ostream& __os, const signed char* __str) { const char *__s = (const char *) __str; @@ -911,7 +911,7 @@ } template -basic_ostream& +_LIBCPP_HIDE_FROM_ABI basic_ostream& operator<<(basic_ostream& __os, const unsigned char* __str) { const char *__s = (const char *) __str; @@ -1032,7 +1032,7 @@ } template -inline +_LIBCPP_HIDE_FROM_ABI inline basic_ostream<_CharT, _Traits>& endl(basic_ostream<_CharT, _Traits>& __os) { @@ -1042,7 +1042,7 @@ } template -inline +_LIBCPP_HIDE_FROM_ABI inline basic_ostream<_CharT, _Traits>& ends(basic_ostream<_CharT, _Traits>& __os) { @@ -1051,7 +1051,7 @@ } template -inline +_LIBCPP_HIDE_FROM_ABI inline basic_ostream<_CharT, _Traits>& flush(basic_ostream<_CharT, _Traits>& __os) { @@ -1087,7 +1087,7 @@ } template -basic_ostream<_CharT, _Traits>& +_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, basic_string_view<_CharT, _Traits> __sv) { @@ -1123,7 +1123,7 @@ } template -basic_ostream<_CharT, _Traits>& +_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, const bitset<_Size>& __x) { return __os << __x.template to_string<_CharT, _Traits> diff --git a/libcxx/include/regex b/libcxx/include/regex --- a/libcxx/include/regex +++ b/libcxx/include/regex @@ -833,7 +833,7 @@ multiline = 1 << 10 }; -inline _LIBCPP_CONSTEXPR +_LIBCPP_HIDE_FROM_ABI inline _LIBCPP_CONSTEXPR syntax_option_type __get_grammar(syntax_option_type __g) { #ifdef _LIBCPP_ABI_REGEX_CONSTANTS_NONZERO @@ -5732,7 +5732,7 @@ } template -bool +_LIBCPP_HIDE_FROM_ABI bool operator==(const match_results<_BidirectionalIterator, _Allocator>& __x, const match_results<_BidirectionalIterator, _Allocator>& __y) { @@ -6224,7 +6224,7 @@ // regex_match template -bool +_LIBCPP_HIDE_FROM_ABI bool regex_match(_BidirectionalIterator __first, _BidirectionalIterator __last, match_results<_BidirectionalIterator, _Allocator>& __m, const basic_regex<_CharT, _Traits>& __e, @@ -6737,7 +6737,7 @@ template -_OutputIterator +_LIBCPP_HIDE_FROM_ABI _OutputIterator regex_replace(_OutputIterator __output_iter, _BidirectionalIterator __first, _BidirectionalIterator __last, const basic_regex<_CharT, _Traits>& __e, const _CharT* __fmt, diff --git a/libcxx/include/string b/libcxx/include/string --- a/libcxx/include/string +++ b/libcxx/include/string @@ -593,17 +593,17 @@ template basic_string<_CharT, _Traits, _Allocator> -_LIBCPP_CONSTEXPR_AFTER_CXX17 +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 operator+(const basic_string<_CharT, _Traits, _Allocator>& __x, const basic_string<_CharT, _Traits, _Allocator>& __y); template -_LIBCPP_CONSTEXPR_AFTER_CXX17 +_LIBCPP_HIDDEN _LIBCPP_CONSTEXPR_AFTER_CXX17 basic_string<_CharT, _Traits, _Allocator> operator+(const _CharT* __x, const basic_string<_CharT,_Traits,_Allocator>& __y); template -_LIBCPP_CONSTEXPR_AFTER_CXX17 +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 basic_string<_CharT, _Traits, _Allocator> operator+(_CharT __x, const basic_string<_CharT,_Traits,_Allocator>& __y); @@ -613,7 +613,7 @@ operator+(const basic_string<_CharT, _Traits, _Allocator>& __x, const _CharT* __y); template -_LIBCPP_CONSTEXPR_AFTER_CXX17 +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 basic_string<_CharT, _Traits, _Allocator> operator+(const basic_string<_CharT, _Traits, _Allocator>& __x, _CharT __y); @@ -4346,7 +4346,7 @@ // operator + template -_LIBCPP_CONSTEXPR_AFTER_CXX17 +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 basic_string<_CharT, _Traits, _Allocator> operator+(const basic_string<_CharT, _Traits, _Allocator>& __lhs, const basic_string<_CharT, _Traits, _Allocator>& __rhs) @@ -4365,7 +4365,7 @@ } template -_LIBCPP_CONSTEXPR_AFTER_CXX17 +_LIBCPP_HIDDEN _LIBCPP_CONSTEXPR_AFTER_CXX17 basic_string<_CharT, _Traits, _Allocator> operator+(const _CharT* __lhs , const basic_string<_CharT,_Traits,_Allocator>& __rhs) { @@ -4383,7 +4383,7 @@ } template -_LIBCPP_CONSTEXPR_AFTER_CXX17 +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 basic_string<_CharT, _Traits, _Allocator> operator+(_CharT __lhs, const basic_string<_CharT,_Traits,_Allocator>& __rhs) { @@ -4418,7 +4418,7 @@ } template -_LIBCPP_CONSTEXPR_AFTER_CXX17 +_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 basic_string<_CharT, _Traits, _Allocator> operator+(const basic_string<_CharT, _Traits, _Allocator>& __lhs, _CharT __rhs) { @@ -4566,17 +4566,17 @@ }; template -basic_ostream<_CharT, _Traits>& +_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, const basic_string<_CharT, _Traits, _Allocator>& __str); template -basic_istream<_CharT, _Traits>& +_LIBCPP_HIDE_FROM_ABI basic_istream<_CharT, _Traits>& operator>>(basic_istream<_CharT, _Traits>& __is, basic_string<_CharT, _Traits, _Allocator>& __str); template -basic_istream<_CharT, _Traits>& +_LIBCPP_HIDE_FROM_ABI basic_istream<_CharT, _Traits>& getline(basic_istream<_CharT, _Traits>& __is, basic_string<_CharT, _Traits, _Allocator>& __str, _CharT __dlm); diff --git a/libcxx/include/string_view b/libcxx/include/string_view --- a/libcxx/include/string_view +++ b/libcxx/include/string_view @@ -913,7 +913,7 @@ template -basic_ostream<_CharT, _Traits>& +_LIBCPP_HIDE_FROM_ABI basic_ostream<_CharT, _Traits>& operator<<(basic_ostream<_CharT, _Traits>& __os, basic_string_view<_CharT, _Traits> __str); diff --git a/libcxx/include/thread b/libcxx/include/thread --- a/libcxx/include/thread +++ b/libcxx/include/thread @@ -361,7 +361,7 @@ _LIBCPP_FUNC_VIS void sleep_for(const chrono::nanoseconds& __ns); template -void +_LIBCPP_HIDE_FROM_ABI void sleep_for(const chrono::duration<_Rep, _Period>& __d) { if (__d > chrono::duration<_Rep, _Period>::zero()) @@ -385,7 +385,7 @@ } template -void +_LIBCPP_HIDE_FROM_ABI void sleep_until(const chrono::time_point<_Clock, _Duration>& __t) { mutex __mut; diff --git a/libcxx/include/unordered_map b/libcxx/include/unordered_map --- a/libcxx/include/unordered_map +++ b/libcxx/include/unordered_map @@ -1886,7 +1886,7 @@ #endif template -bool +_LIBCPP_HIDE_FROM_ABI bool operator==(const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __x, const unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>& __y) { @@ -2592,7 +2592,7 @@ #endif template -bool +_LIBCPP_HIDE_FROM_ABI bool operator==(const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __x, const unordered_multimap<_Key, _Tp, _Hash, _Pred, _Alloc>& __y) { diff --git a/libcxx/include/unordered_set b/libcxx/include/unordered_set --- a/libcxx/include/unordered_set +++ b/libcxx/include/unordered_set @@ -1130,7 +1130,7 @@ #endif template -bool +_LIBCPP_HIDE_FROM_ABI bool operator==(const unordered_set<_Value, _Hash, _Pred, _Alloc>& __x, const unordered_set<_Value, _Hash, _Pred, _Alloc>& __y) { @@ -1768,7 +1768,7 @@ #endif template -bool +_LIBCPP_HIDE_FROM_ABI bool operator==(const unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __x, const unordered_multiset<_Value, _Hash, _Pred, _Alloc>& __y) { diff --git a/libcxx/include/variant b/libcxx/include/variant --- a/libcxx/include/variant +++ b/libcxx/include/variant @@ -320,7 +320,7 @@ inline constexpr size_t variant_npos = static_cast(-1); -constexpr int __choose_index_type(unsigned int __num_elem) { +_LIBCPP_HIDE_FROM_ABI constexpr int __choose_index_type(unsigned int __num_elem) { if (__num_elem < numeric_limits::max()) return 0; if (__num_elem < numeric_limits::max()) diff --git a/libcxx/test/libcxx/clang_query.sh.cpp b/libcxx/test/libcxx/clang_query.sh.cpp new file mode 100644 --- /dev/null +++ b/libcxx/test/libcxx/clang_query.sh.cpp @@ -0,0 +1,268 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// REQUIRES: has-clang-query + +// RUN: clang-query -f %S/clang_query/hide_from_abi_or_visible.query %s --use-color -- -Wno-unknown-warning-option %{compile_flags} -fno-modules > %t.output +// RUN: cat %t.output +// RUN: cat %t.output | wc -l | grep -Fxq 1 + +// Prevent from generating deprecated warnings for this test. +#if defined(__DEPRECATED) +# undef __DEPRECATED +#endif + +/* +BEGIN-SCRIPT + +for header in public_headers: + print("{}#{}include <{}>{}".format( + '#if ' + header_restrictions[header] + '\n' if header in header_restrictions else '', + 3 * ' ' if header in header_restrictions else '', + header, + '\n#endif' if header in header_restrictions else '' + )) + +END-SCRIPT +*/ + +// DO NOT MANUALLY EDIT ANYTHING BETWEEN THE MARKERS BELOW +// GENERATED-MARKER +#include +#include +#include +#include +#if !defined(_LIBCPP_HAS_NO_THREADS) +# include +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#if !defined(_LIBCPP_HAS_NO_LOCALIZATION) +# include +#endif +#include +#if !defined(_LIBCPP_HAS_NO_LOCALIZATION) +# include +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#if !defined(_LIBCPP_HAS_NO_WIDE_CHARACTERS) +# include +#endif +#if !defined(_LIBCPP_HAS_NO_WIDE_CHARACTERS) +# include +#endif +#include +#include +#include +#include +#include +#if !defined(_LIBCPP_HAS_NO_FILESYSTEM_LIBRARY) +# include +#endif +#include +#include +#include +#if !defined(_LIBCPP_HAS_NO_LOCALIZATION) +# include +#endif +#include +#if !defined(_LIBCPP_HAS_NO_THREADS) +# include +#endif +#include +#include +#if !defined(_LIBCPP_HAS_NO_LOCALIZATION) +# include +#endif +#if !defined(_LIBCPP_HAS_NO_LOCALIZATION) +# include +#endif +#include +#if !defined(_LIBCPP_HAS_NO_LOCALIZATION) +# include +#endif +#if !defined(_LIBCPP_HAS_NO_LOCALIZATION) +# include +#endif +#include +#if !defined(_LIBCPP_HAS_NO_THREADS) +# include +#endif +#include +#include +#include +#if !defined(_LIBCPP_HAS_NO_LOCALIZATION) +# include +#endif +#if !defined(_LIBCPP_HAS_NO_LOCALIZATION) +# include +#endif +#include +#include +#include +#if !defined(_LIBCPP_HAS_NO_THREADS) +# include +#endif +#include +#include +#include +#include +#if !defined(_LIBCPP_HAS_NO_LOCALIZATION) +# include +#endif +#include +#include +#include +#include +#if !defined(_LIBCPP_HAS_NO_LOCALIZATION) +# include +#endif +#include +#if !defined(_LIBCPP_HAS_NO_THREADS) +# include +#endif +#include +#include +#if !defined(_LIBCPP_HAS_NO_THREADS) +# include +#endif +#include +#if !defined(_LIBCPP_HAS_NO_LOCALIZATION) +# include +#endif +#include +#if __cplusplus > 202002L && !defined(_LIBCPP_HAS_NO_THREADS) +# include +#endif +#include +#include +#include +#include +#include +#include +#if !defined(_LIBCPP_HAS_NO_LOCALIZATION) +# include +#endif +#include +#include +#include +#if !defined(_LIBCPP_HAS_NO_LOCALIZATION) +# include +#endif +#include +#include +#if !defined(_LIBCPP_HAS_NO_THREADS) +# include +#endif +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#if !defined(_LIBCPP_HAS_NO_WIDE_CHARACTERS) +# include +#endif +#if !defined(_LIBCPP_HAS_NO_WIDE_CHARACTERS) +# include +#endif +#if __cplusplus >= 201103L +# include +#endif +#if __cplusplus >= 201103L && !defined(_LIBCPP_HAS_NO_EXPERIMENTAL_COROUTINES) +# include +#endif +#if __cplusplus >= 201103L +# include +#endif +#if __cplusplus >= 201103L +# include +#endif +#if __cplusplus >= 201103L +# include +#endif +#if __cplusplus >= 201103L +# include +#endif +#if __cplusplus >= 201103L +# include +#endif +#if __cplusplus >= 201103L +# include +#endif +#if __cplusplus >= 201103L +# include +#endif +#if __cplusplus >= 201103L +# include +#endif +#if !defined(_LIBCPP_HAS_NO_LOCALIZATION) && __cplusplus >= 201103L +# include +#endif +#if __cplusplus >= 201103L +# include +#endif +#if __cplusplus >= 201103L +# include +#endif +#if __cplusplus >= 201103L +# include +#endif +#if __cplusplus >= 201103L +# include +#endif +#if __cplusplus >= 201103L +# include +#endif +#if __cplusplus >= 201103L +# include +#endif +#if __cplusplus >= 201103L +# include +#endif +#if __cplusplus >= 201103L +# include +#endif +#include +#include +// GENERATED-MARKER diff --git a/libcxx/test/libcxx/clang_query/README.md b/libcxx/test/libcxx/clang_query/README.md new file mode 100644 --- /dev/null +++ b/libcxx/test/libcxx/clang_query/README.md @@ -0,0 +1,4 @@ + +This directory contains [AST matchers](https://clang.llvm.org/docs/LibASTMatchers.html) for clang-query. +These allow us to enforce some rules in the libc++ source code which are hard to enforce through other means, +like clang-tidy or regex matchers. diff --git a/libcxx/test/libcxx/clang_query/hide_from_abi_or_visible.query b/libcxx/test/libcxx/clang_query/hide_from_abi_or_visible.query new file mode 100644 --- /dev/null +++ b/libcxx/test/libcxx/clang_query/hide_from_abi_or_visible.query @@ -0,0 +1,37 @@ +#===------------------------------------------------------------------------===# +# +# Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +# See https://llvm.org/LICENSE.txt for license information. +# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +# +#===------------------------------------------------------------------------===# + +# Check that all functions in the libc++ headers are either marked with hidden +# visibility or default visibility + +# TODO: enable the check for all functions once we don't force-inline everything with GCC +match +functionDecl( + unless( + anyOf( + hasName("__introsort"), + hasName("__inplace_merge"), + hasName("__libcpp_snprintf_l"), + hasName("__libcpp_asprintf_l"), + hasName("__libcpp_sscanf_l"), + hasName("__tree_sub_invariant"), + hasName("__stable_sort_move"), + hasName("__stable_sort"), + hasName("__stable_partition"), + hasName("__lock_first"), + hasName("__stable_partition_impl"), + hasAttr("attr::Visibility"), + hasAttr("attr::AbiTag"), + cxxMethodDecl(), + isDeleted(), + isConsteval(), + isExpansionInSystemHeader() + ) + ), + isDefinition() +) diff --git a/libcxx/utils/libcxx/test/features.py b/libcxx/utils/libcxx/test/features.py --- a/libcxx/utils/libcxx/test/features.py +++ b/libcxx/utils/libcxx/test/features.py @@ -24,6 +24,11 @@ except ConfigurationRuntimeError: return False +def _hasSuitableClangQuery(cfg): + try: + return int(re.search('[0-9]+', commandOutput(cfg, ['clang-query --version'])).group()) >= 13 + except ConfigurationRuntimeError: + return False DEFAULT_FEATURES = [ Feature(name='fcoroutines-ts', @@ -137,6 +142,8 @@ when=lambda cfg: runScriptExitCode(cfg, ['%{exec} bash -c \'bash --version\'']) != 0), Feature(name='has-clang-tidy', when=_hasSuitableClangTidy), + Feature(name='has-clang-query', + when=_hasSuitableClangQuery), Feature(name='apple-clang', when=_isAppleClang), Feature(name=lambda cfg: 'apple-clang-{__clang_major__}'.format(**compilerMacros(cfg)), when=_isAppleClang), diff --git a/libcxx/utils/libcxx/test/params.py b/libcxx/utils/libcxx/test/params.py --- a/libcxx/utils/libcxx/test/params.py +++ b/libcxx/utils/libcxx/test/params.py @@ -38,8 +38,9 @@ # TODO(mordante) investigate a solution for this issue. '-Wno-tautological-compare', - # -Wstringop-overread seems to be a bit buggy currently + # -Wstringop-overread and -Wstringop-overflow seem to be a bit buggy currently '-Wno-stringop-overread', + '-Wno-stringop-overflow', # These warnings should be enabled in order to support the MSVC # team using the test suite; They enable the warnings below and