Skip to content

Commit 5146b57

Browse files
committed
[libc++][NFC] Rename the constexpr macros
This was discussed on Discord with the consensus that we should rename the macros. Reviewed By: ldionne, Mordante, var-const, avogelsgesang, jloser, #libc Spies: libcxx-commits Differential Revision: https://reviews.llvm.org/D131498
1 parent ac31781 commit 5146b57

File tree

164 files changed

+1999
-1999
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

164 files changed

+1999
-1999
lines changed

libcxx/.clang-format

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,10 +12,10 @@ AllowShortFunctionsOnASingleLine: true
1212
AllowShortLambdasOnASingleLine: All
1313
AttributeMacros: ['_LIBCPP_HIDE_FROM_ABI',
1414
'_LIBCPP_CONSTEXPR',
15-
'_LIBCPP_CONSTEXPR_AFTER_CXX11',
16-
'_LIBCPP_CONSTEXPR_AFTER_CXX14',
17-
'_LIBCPP_CONSTEXPR_AFTER_CXX17',
18-
'_LIBCPP_CONSTEXPR_AFTER_CXX20',
15+
'_LIBCPP_CONSTEXPR_SINCE_CXX14',
16+
'_LIBCPP_CONSTEXPR_SINCE_CXX17',
17+
'_LIBCPP_CONSTEXPR_SINCE_CXX20',
18+
'_LIBCPP_CONSTEXPR_SINCE_CXX23',
1919
'_LIBCPP_ALIGNOF',
2020
'_ALIGNAS_TYPE',
2121
'_ALIGNAS',

libcxx/include/__algorithm/adjacent_find.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
_LIBCPP_BEGIN_NAMESPACE_STD
2424

2525
template <class _Iter, class _Sent, class _BinaryPredicate>
26-
_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 _Iter
26+
_LIBCPP_NODISCARD_EXT _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Iter
2727
__adjacent_find(_Iter __first, _Sent __last, _BinaryPredicate&& __pred) {
2828
if (__first == __last)
2929
return __first;
@@ -37,13 +37,13 @@ __adjacent_find(_Iter __first, _Sent __last, _BinaryPredicate&& __pred) {
3737
}
3838

3939
template <class _ForwardIterator, class _BinaryPredicate>
40-
_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator
40+
_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _ForwardIterator
4141
adjacent_find(_ForwardIterator __first, _ForwardIterator __last, _BinaryPredicate __pred) {
4242
return std::__adjacent_find(std::move(__first), std::move(__last), __pred);
4343
}
4444

4545
template <class _ForwardIterator>
46-
_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 _ForwardIterator
46+
_LIBCPP_NODISCARD_EXT inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _ForwardIterator
4747
adjacent_find(_ForwardIterator __first, _ForwardIterator __last) {
4848
typedef typename iterator_traits<_ForwardIterator>::value_type __v;
4949
return std::adjacent_find(std::move(__first), std::move(__last), __equal_to<__v>());

libcxx/include/__algorithm/all_of.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
_LIBCPP_BEGIN_NAMESPACE_STD
2020

2121
template <class _InputIterator, class _Predicate>
22-
_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 bool
22+
_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 bool
2323
all_of(_InputIterator __first, _InputIterator __last, _Predicate __pred) {
2424
for (; __first != __last; ++__first)
2525
if (!__pred(*__first))

libcxx/include/__algorithm/any_of.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
_LIBCPP_BEGIN_NAMESPACE_STD
2020

2121
template <class _InputIterator, class _Predicate>
22-
_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17 bool
22+
_LIBCPP_NODISCARD_EXT inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20 bool
2323
any_of(_InputIterator __first, _InputIterator __last, _Predicate __pred) {
2424
for (; __first != __last; ++__first)
2525
if (__pred(*__first))

libcxx/include/__algorithm/binary_search.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
2323

2424
template <class _ForwardIterator, class _Tp, class _Compare>
2525
_LIBCPP_NODISCARD_EXT inline
26-
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
26+
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
2727
bool
2828
binary_search(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value, _Compare __comp)
2929
{
@@ -34,7 +34,7 @@ binary_search(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __va
3434

3535
template <class _ForwardIterator, class _Tp>
3636
_LIBCPP_NODISCARD_EXT inline
37-
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
37+
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
3838
bool
3939
binary_search(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value)
4040
{

libcxx/include/__algorithm/comp.h

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,67 +23,67 @@ _LIBCPP_BEGIN_NAMESPACE_STD
2323
template <class _T1, class _T2 = _T1>
2424
struct __equal_to
2525
{
26-
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 bool operator()(const _T1& __x, const _T1& __y) const {return __x == __y;}
27-
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 bool operator()(const _T1& __x, const _T2& __y) const {return __x == __y;}
28-
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 bool operator()(const _T2& __x, const _T1& __y) const {return __x == __y;}
29-
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11 bool operator()(const _T2& __x, const _T2& __y) const {return __x == __y;}
26+
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14 bool operator()(const _T1& __x, const _T1& __y) const {return __x == __y;}
27+
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14 bool operator()(const _T1& __x, const _T2& __y) const {return __x == __y;}
28+
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14 bool operator()(const _T2& __x, const _T1& __y) const {return __x == __y;}
29+
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14 bool operator()(const _T2& __x, const _T2& __y) const {return __x == __y;}
3030
};
3131

3232
template <class _T1>
3333
struct __equal_to<_T1, _T1>
3434
{
35-
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
35+
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
3636
bool operator()(const _T1& __x, const _T1& __y) const {return __x == __y;}
3737
};
3838

3939
template <class _T1>
4040
struct __equal_to<const _T1, _T1>
4141
{
42-
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
42+
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
4343
bool operator()(const _T1& __x, const _T1& __y) const {return __x == __y;}
4444
};
4545

4646
template <class _T1>
4747
struct __equal_to<_T1, const _T1>
4848
{
49-
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
49+
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
5050
bool operator()(const _T1& __x, const _T1& __y) const {return __x == __y;}
5151
};
5252

5353
template <class _T1, class _T2 = _T1>
5454
struct __less
5555
{
56-
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
56+
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
5757
bool operator()(const _T1& __x, const _T1& __y) const {return __x < __y;}
5858

59-
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
59+
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
6060
bool operator()(const _T1& __x, const _T2& __y) const {return __x < __y;}
6161

62-
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
62+
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
6363
bool operator()(const _T2& __x, const _T1& __y) const {return __x < __y;}
6464

65-
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
65+
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
6666
bool operator()(const _T2& __x, const _T2& __y) const {return __x < __y;}
6767
};
6868

6969
template <class _T1>
7070
struct __less<_T1, _T1>
7171
{
72-
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
72+
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
7373
bool operator()(const _T1& __x, const _T1& __y) const {return __x < __y;}
7474
};
7575

7676
template <class _T1>
7777
struct __less<const _T1, _T1>
7878
{
79-
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
79+
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
8080
bool operator()(const _T1& __x, const _T1& __y) const {return __x < __y;}
8181
};
8282

8383
template <class _T1>
8484
struct __less<_T1, const _T1>
8585
{
86-
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX11
86+
_LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX14
8787
bool operator()(const _T1& __x, const _T1& __y) const {return __x < __y;}
8888
};
8989

libcxx/include/__algorithm/comp_ref_type.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ template <class _Compare>
2323
struct __debug_less
2424
{
2525
_Compare &__comp_;
26-
_LIBCPP_CONSTEXPR_AFTER_CXX11
26+
_LIBCPP_CONSTEXPR_SINCE_CXX14
2727
__debug_less(_Compare& __c) : __comp_(__c) {}
2828

2929
template <class _Tp, class _Up>
30-
_LIBCPP_CONSTEXPR_AFTER_CXX11
30+
_LIBCPP_CONSTEXPR_SINCE_CXX14
3131
bool operator()(const _Tp& __x, const _Up& __y)
3232
{
3333
bool __r = __comp_(__x, __y);
@@ -37,7 +37,7 @@ struct __debug_less
3737
}
3838

3939
template <class _Tp, class _Up>
40-
_LIBCPP_CONSTEXPR_AFTER_CXX11
40+
_LIBCPP_CONSTEXPR_SINCE_CXX14
4141
bool operator()(_Tp& __x, _Up& __y)
4242
{
4343
bool __r = __comp_(__x, __y);
@@ -47,7 +47,7 @@ struct __debug_less
4747
}
4848

4949
template <class _LHS, class _RHS>
50-
_LIBCPP_CONSTEXPR_AFTER_CXX11
50+
_LIBCPP_CONSTEXPR_SINCE_CXX14
5151
inline _LIBCPP_INLINE_VISIBILITY
5252
decltype((void)declval<_Compare&>()(
5353
declval<_LHS &>(), declval<_RHS &>()))
@@ -59,7 +59,7 @@ struct __debug_less
5959
}
6060

6161
template <class _LHS, class _RHS>
62-
_LIBCPP_CONSTEXPR_AFTER_CXX11
62+
_LIBCPP_CONSTEXPR_SINCE_CXX14
6363
inline _LIBCPP_INLINE_VISIBILITY
6464
void __do_compare_assert(long, _LHS &, _RHS &) {}
6565
};

libcxx/include/__algorithm/copy.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
2828
// copy
2929

3030
template <class _InIter, class _Sent, class _OutIter>
31-
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11
31+
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
3232
pair<_InIter, _OutIter> __copy_impl(_InIter __first, _Sent __last, _OutIter __result) {
3333
while (__first != __last) {
3434
*__result = *__first;
@@ -42,7 +42,7 @@ template <class _InValueT,
4242
class _OutValueT,
4343
class = __enable_if_t<is_same<typename remove_const<_InValueT>::type, _OutValueT>::value
4444
&& is_trivially_copy_assignable<_OutValueT>::value> >
45-
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11
45+
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
4646
pair<_InValueT*, _OutValueT*> __copy_impl(_InValueT* __first, _InValueT* __last, _OutValueT* __result) {
4747
if (__libcpp_is_constant_evaluated()
4848
// TODO: Remove this once GCC supports __builtin_memmove during constant evaluation
@@ -64,7 +64,7 @@ template <class _InIter, class _OutIter,
6464
&& is_trivially_copy_assignable<__iter_value_type<_OutIter> >::value
6565
&& __is_reverse_iterator<_InIter>::value
6666
&& __is_reverse_iterator<_OutIter>::value, int> = 0>
67-
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11
67+
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
6868
pair<_InIter, _OutIter>
6969
__copy_impl(_InIter __first, _InIter __last, _OutIter __result) {
7070
auto __first_base = std::__unwrap_iter(__first.base());
@@ -79,7 +79,7 @@ template <class _InIter, class _Sent, class _OutIter,
7979
__enable_if_t<!(is_copy_constructible<_InIter>::value
8080
&& is_copy_constructible<_Sent>::value
8181
&& is_copy_constructible<_OutIter>::value), int> = 0 >
82-
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11
82+
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
8383
pair<_InIter, _OutIter> __copy(_InIter __first, _Sent __last, _OutIter __result) {
8484
return std::__copy_impl(std::move(__first), std::move(__last), std::move(__result));
8585
}
@@ -88,7 +88,7 @@ template <class _InIter, class _Sent, class _OutIter,
8888
__enable_if_t<is_copy_constructible<_InIter>::value
8989
&& is_copy_constructible<_Sent>::value
9090
&& is_copy_constructible<_OutIter>::value, int> = 0>
91-
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11
91+
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
9292
pair<_InIter, _OutIter> __copy(_InIter __first, _Sent __last, _OutIter __result) {
9393
auto __range = std::__unwrap_range(__first, __last);
9494
auto __ret = std::__copy_impl(std::move(__range.first), std::move(__range.second), std::__unwrap_iter(__result));
@@ -97,7 +97,7 @@ pair<_InIter, _OutIter> __copy(_InIter __first, _Sent __last, _OutIter __result)
9797
}
9898

9999
template <class _InputIterator, class _OutputIterator>
100-
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
100+
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
101101
_OutputIterator
102102
copy(_InputIterator __first, _InputIterator __last, _OutputIterator __result) {
103103
return std::__copy(__first, __last, __result).second;

libcxx/include/__algorithm/copy_backward.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD
3131

3232
template <class _AlgPolicy, class _InputIterator, class _OutputIterator,
3333
__enable_if_t<is_same<_AlgPolicy, _ClassicAlgPolicy>::value, int> = 0>
34-
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX11 pair<_InputIterator, _OutputIterator>
34+
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 pair<_InputIterator, _OutputIterator>
3535
__copy_backward(_InputIterator __first, _InputIterator __last, _OutputIterator __result) {
3636
auto __ret = std::__copy(
3737
__unconstrained_reverse_iterator<_InputIterator>(__last),
@@ -52,7 +52,7 @@ _LIBCPP_HIDE_FROM_ABI constexpr pair<_Iter1, _Iter2> __copy_backward(_Iter1 __fi
5252
#endif // _LIBCPP_STD_VER > 17
5353

5454
template <class _BidirectionalIterator1, class _BidirectionalIterator2>
55-
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_AFTER_CXX17 _BidirectionalIterator2
55+
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _BidirectionalIterator2
5656
copy_backward(_BidirectionalIterator1 __first, _BidirectionalIterator1 __last, _BidirectionalIterator2 __result) {
5757
return std::__copy_backward<_ClassicAlgPolicy>(__first, __last, __result).second;
5858
}

libcxx/include/__algorithm/copy_if.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
_LIBCPP_BEGIN_NAMESPACE_STD
1919

2020
template<class _InputIterator, class _OutputIterator, class _Predicate>
21-
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_AFTER_CXX17
21+
inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_CONSTEXPR_SINCE_CXX20
2222
_OutputIterator
2323
copy_if(_InputIterator __first, _InputIterator __last,
2424
_OutputIterator __result, _Predicate __pred)

0 commit comments

Comments
 (0)