]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Fix uses of non-reserved names in simd header
authorMatthias Kretz <m.kretz@gsi.de>
Thu, 16 Feb 2023 15:29:54 +0000 (16:29 +0100)
committerMatthias Kretz <m.kretz@gsi.de>
Thu, 23 Feb 2023 10:42:46 +0000 (11:42 +0100)
Signed-off-by: Matthias Kretz <m.kretz@gsi.de>
libstdc++-v3/ChangeLog:

* include/experimental/bits/simd.h (__extract_part, split):
Use reserved name for template parameter.

(cherry picked from commit bb920f561e983c64d146f173dc4ebc098441a962)

libstdc++-v3/include/experimental/bits/simd.h

index 2b1e5bcbe946641ab865da20f6f934639f904aa1..7bdda6e6aae3085c8a09429c49347ffe1a93cf29 100644 (file)
@@ -3774,7 +3774,7 @@ template <int _Index, int _Total, int _Combine = 1, typename _Tp, size_t _Np>
   _SimdWrapper<_Tp, _Np / _Total * _Combine>
   __extract_part(const _SimdWrapper<_Tp, _Np> __x);
 
-template <int Index, int Parts, int _Combine = 1, typename _Tp, typename _A0,
+template <int _Index, int _Parts, int _Combine = 1, typename _Tp, typename _A0,
          typename... _As>
   _GLIBCXX_SIMD_INTRINSIC auto
   __extract_part(const _SimdTuple<_Tp, _A0, _As...>& __x);
@@ -3887,19 +3887,19 @@ template <size_t... _Sizes, typename _Tp, typename... _As>
 
 // split<simd>(simd) {{{
 template <typename _V, typename _Ap,
-         size_t Parts = simd_size_v<typename _V::value_type, _Ap> / _V::size()>
-  enable_if_t<simd_size_v<typename _V::value_type, _Ap> == Parts * _V::size()
-             && is_simd_v<_V>, array<_V, Parts>>
+         size_t _Parts = simd_size_v<typename _V::value_type, _Ap> / _V::size()>
+  enable_if_t<simd_size_v<typename _V::value_type, _Ap> == _Parts * _V::size()
+               && is_simd_v<_V>, array<_V, _Parts>>
   split(const simd<typename _V::value_type, _Ap>& __x)
   {
     using _Tp = typename _V::value_type;
-    if constexpr (Parts == 1)
+    if constexpr (_Parts == 1)
       {
        return {simd_cast<_V>(__x)};
       }
     else if (__x._M_is_constprop())
       {
-       return __generate_from_n_evaluations<Parts, array<_V, Parts>>([&](
+       return __generate_from_n_evaluations<_Parts, array<_V, _Parts>>([&](
          auto __i) constexpr {
          return _V([&](auto __j) constexpr {
            return __x[__i * _V::size() + __j];
@@ -3917,13 +3917,13 @@ template <typename _V, typename _Ap,
 #ifdef _GLIBCXX_SIMD_USE_ALIASING_LOADS
       const __may_alias<_Tp>* const __element_ptr
        = reinterpret_cast<const __may_alias<_Tp>*>(&__data(__x));
-      return __generate_from_n_evaluations<Parts, array<_V, Parts>>([&](
+      return __generate_from_n_evaluations<_Parts, array<_V, _Parts>>([&](
        auto __i) constexpr {
        return _V(__element_ptr + __i * _V::size(), vector_aligned);
       });
 #else
       const auto& __xx = __data(__x);
-      return __generate_from_n_evaluations<Parts, array<_V, Parts>>([&](
+      return __generate_from_n_evaluations<_Parts, array<_V, _Parts>>([&](
        auto __i) constexpr {
        [[maybe_unused]] constexpr size_t __offset
          = decltype(__i)::value * _V::size();
@@ -3937,12 +3937,12 @@ template <typename _V, typename _Ap,
   else if constexpr (is_same_v<typename _V::abi_type, simd_abi::scalar>)
     {
       // normally memcpy should work here as well
-      return __generate_from_n_evaluations<Parts, array<_V, Parts>>([&](
+      return __generate_from_n_evaluations<_Parts, array<_V, _Parts>>([&](
        auto __i) constexpr { return __x[__i]; });
     }
   else
     {
-      return __generate_from_n_evaluations<Parts, array<_V, Parts>>([&](
+      return __generate_from_n_evaluations<_Parts, array<_V, _Parts>>([&](
        auto __i) constexpr {
        if constexpr (__is_fixed_size_abi_v<typename _V::abi_type>)
          return _V([&](auto __j) constexpr {
@@ -3950,7 +3950,7 @@ template <typename _V, typename _Ap,
          });
        else
          return _V(__private_init,
-                   __extract_part<decltype(__i)::value, Parts>(__data(__x)));
+                   __extract_part<decltype(__i)::value, _Parts>(__data(__x)));
       });
     }
   }