[libcxx-commits] [libcxx] d231b50 - [libc++] Fix naming of value template parameters (#76888)

via libcxx-commits libcxx-commits at lists.llvm.org
Thu Jun 6 22:43:24 PDT 2024


Author: Nikolas Klauser
Date: 2024-06-07T07:43:20+02:00
New Revision: d231b50dba6cf1b3ab095d381ae622e9498bbb3c

URL: https://github.com/llvm/llvm-project/commit/d231b50dba6cf1b3ab095d381ae622e9498bbb3c
DIFF: https://github.com/llvm/llvm-project/commit/d231b50dba6cf1b3ab095d381ae622e9498bbb3c.diff

LOG: [libc++] Fix naming of value template parameters (#76888)

Added: 
    

Modified: 
    libcxx/.clang-tidy
    libcxx/include/__functional/bind.h
    libcxx/include/__mdspan/extents.h

Removed: 
    


################################################################################
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