[libcxx-commits] [libcxx] [libc++] Fix naming of value template parameters (PR #76888)
Nikolas Klauser via libcxx-commits
libcxx-commits at lists.llvm.org
Thu Jun 6 10:24:49 PDT 2024
https://github.com/philnik777 updated https://github.com/llvm/llvm-project/pull/76888
>From cdf406ab7bc00f6625b34581b3be29791c220244 Mon Sep 17 00:00:00 2001
From: Nikolas Klauser <nikolasklauser at berlin.de>
Date: Thu, 4 Jan 2024 04:20:45 +0100
Subject: [PATCH] [libc++] Fix naming of value template parameters
---
libcxx/.clang-tidy | 8 ++++++--
libcxx/include/__functional/bind.h | 4 ++--
libcxx/include/__mdspan/extents.h | 6 +++---
3 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/libcxx/.clang-tidy b/libcxx/.clang-tidy
index ec7cab9b878ed..d0b4cced9ffc3 100644
--- a/libcxx/.clang-tidy
+++ b/libcxx/.clang-tidy
@@ -57,8 +57,12 @@ CheckOptions:
value: _
- key: readability-identifier-naming.TemplateParameterIgnoredRegexp
value: (.*\:auto|expr-type) # This is https://llvm.org/PR56464
- - key: readability-identifier-naming.ValueTemplateParameterIgnoredRegexp # TODO: enforce naming of variable parameters
- value: .*
+ - key: readability-identifier-naming.ValueTemplateParameterCase
+ value: CamelCase
+ - key: readability-identifier-naming.ValueTemplateParameterPrefix
+ value: _
+ - key: readability-identifier-naming.ValueTemplateParameterIgnoredRegexp
+ value: (__[a-z_]|_[A-Z]).* # TODO: Converge on a single style for value template parameters
# TODO: investigate these checks
# bugprone-branch-clone,
diff --git a/libcxx/include/__functional/bind.h b/libcxx/include/__functional/bind.h
index 8a0e3b7ffa584..385dabaee424d 100644
--- a/libcxx/include/__functional/bind.h
+++ b/libcxx/include/__functional/bind.h
@@ -95,7 +95,7 @@ __mu(_Ti& __ti, tuple<_Uj...>& __uj) {
return std::__mu_expand(__ti, __uj, __indices());
}
-template <bool IsPh, class _Ti, class _Uj>
+template <bool _IsPh, class _Ti, class _Uj>
struct __mu_return2 {};
template <class _Ti, class _Uj>
@@ -120,7 +120,7 @@ inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20 _Ti& __mu(_Ti& __ti,
return __ti;
}
-template <class _Ti, bool IsReferenceWrapper, bool IsBindEx, bool IsPh, class _TupleUj>
+template <class _Ti, bool _IsReferenceWrapper, bool _IsBindEx, bool _IsPh, class _TupleUj>
struct __mu_return_impl;
template <bool _Invokable, class _Ti, class... _Uj>
diff --git a/libcxx/include/__mdspan/extents.h b/libcxx/include/__mdspan/extents.h
index f6bcd940ee607..16fac13549614 100644
--- a/libcxx/include/__mdspan/extents.h
+++ b/libcxx/include/__mdspan/extents.h
@@ -137,9 +137,9 @@ struct __maybe_static_array {
// static mapping of indices to the position in the dynamic values array
using _DynamicIdxMap = __static_partial_sums<static_cast<size_t>(_Values == _DynTag)...>;
- template <size_t... Indices>
- _LIBCPP_HIDE_FROM_ABI static constexpr _DynamicValues __zeros(index_sequence<Indices...>) noexcept {
- return _DynamicValues{((void)Indices, 0)...};
+ template <size_t... _Indices>
+ _LIBCPP_HIDE_FROM_ABI static constexpr _DynamicValues __zeros(index_sequence<_Indices...>) noexcept {
+ return _DynamicValues{((void)_Indices, 0)...};
}
public:
More information about the libcxx-commits
mailing list