Skip to content

Commit d231b50

Browse files
authored
[libc++] Fix naming of value template parameters (#76888)
1 parent c5ff983 commit d231b50

File tree

3 files changed

+11
-7
lines changed

3 files changed

+11
-7
lines changed

libcxx/.clang-tidy

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,12 @@ CheckOptions:
5757
value: _
5858
- key: readability-identifier-naming.TemplateParameterIgnoredRegexp
5959
value: (.*\:auto|expr-type) # This is https://llvm.org/PR56464
60-
- key: readability-identifier-naming.ValueTemplateParameterIgnoredRegexp # TODO: enforce naming of variable parameters
61-
value: .*
60+
- key: readability-identifier-naming.ValueTemplateParameterCase
61+
value: CamelCase
62+
- key: readability-identifier-naming.ValueTemplateParameterPrefix
63+
value: _
64+
- key: readability-identifier-naming.ValueTemplateParameterIgnoredRegexp
65+
value: (__[a-z_]|_[A-Z]).* # TODO: Converge on a single style for value template parameters
6266

6367
# TODO: investigate these checks
6468
# bugprone-branch-clone,

libcxx/include/__functional/bind.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ __mu(_Ti& __ti, tuple<_Uj...>& __uj) {
9595
return std::__mu_expand(__ti, __uj, __indices());
9696
}
9797

98-
template <bool IsPh, class _Ti, class _Uj>
98+
template <bool _IsPh, class _Ti, class _Uj>
9999
struct __mu_return2 {};
100100

101101
template <class _Ti, class _Uj>
@@ -120,7 +120,7 @@ inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Ti& __mu(_Ti& __ti,
120120
return __ti;
121121
}
122122

123-
template <class _Ti, bool IsReferenceWrapper, bool IsBindEx, bool IsPh, class _TupleUj>
123+
template <class _Ti, bool _IsReferenceWrapper, bool _IsBindEx, bool _IsPh, class _TupleUj>
124124
struct __mu_return_impl;
125125

126126
template <bool _Invokable, class _Ti, class... _Uj>

libcxx/include/__mdspan/extents.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -137,9 +137,9 @@ struct __maybe_static_array {
137137
// static mapping of indices to the position in the dynamic values array
138138
using _DynamicIdxMap = __static_partial_sums<static_cast<size_t>(_Values == _DynTag)...>;
139139

140-
template <size_t... Indices>
141-
_LIBCPP_HIDE_FROM_ABI static constexpr _DynamicValues __zeros(index_sequence<Indices...>) noexcept {
142-
return _DynamicValues{((void)Indices, 0)...};
140+
template <size_t... _Indices>
141+
_LIBCPP_HIDE_FROM_ABI static constexpr _DynamicValues __zeros(index_sequence<_Indices...>) noexcept {
142+
return _DynamicValues{((void)_Indices, 0)...};
143143
}
144144

145145
public:

0 commit comments

Comments
 (0)