]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
libstdc++: Don't use reserved identifiers in simd headers
authorRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Wed, 3 Mar 2021 12:16:35 +0000 (13:16 +0100)
committerRainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Wed, 3 Mar 2021 12:16:35 +0000 (13:16 +0100)
Two simd tests FAIL on Solaris, both SPARC and x86:

FAIL: experimental/simd/standard_abi_usable.cc -msse2 -O2 -Wno-psabi (test for excess errors)
FAIL: experimental/simd/standard_abi_usable_2.cc -msse2 -O2 -Wno-psabi (test for excess errors)

This happens because the simd headers use identifiers documented in the
libstdc++ manual as reserved by system headers.

Fixed as follows, tested on i386-pc-solaris2.11, sparc-sun-solaris2.11,
and x86_64-pc-linux-gnu.

2021-02-01  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>

libstdc++-v3:
* include/experimental/bits/simd.h: Replace reserved _X, _B by
_Xp, _Bp.
* include/experimental/bits/simd_builtin.h: Likewise.
* include/experimental/bits/simd_x86.h: Likewise.

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

index c452778832fa936aa9e7fe239f4306482dbfa02d..59ddf3cc9581994c3387ec9ec4030d6a7e05a987 100644 (file)
@@ -201,8 +201,8 @@ template <size_t _Np>
   inline constexpr overaligned_tag<_Np> overaligned = {};
 
 // }}}
-template <size_t _X>
-  using _SizeConstant = integral_constant<size_t, _X>;
+template <size_t _Xp>
+  using _SizeConstant = integral_constant<size_t, _Xp>;
 
 namespace __detail
 {
@@ -4208,11 +4208,11 @@ template <template <int> class _A0, template <int> class... _Rest>
              return typename __decay_abi<_A0<_Bytes>>::type{};
            else
              {
-               using _B =
+               using _Bp =
                  typename __find_next_valid_abi<_A0, _Bytes, _Tp>::type;
-               if constexpr (_B::template _S_is_valid_v<
-                               _Tp> && _B::template _S_size<_Tp> <= _Np)
-                 return _B{};
+               if constexpr (_Bp::template _S_is_valid_v<
+                               _Tp> && _Bp::template _S_size<_Tp> <= _Np)
+                 return _Bp{};
                else
                  return
                    typename _AbiList<_Rest...>::template _BestAbi<_Tp, _Np>{};
index 7f728a10488b75280eb15a1f71dafaaf7b115d20..e986ee916208ad9a25d19ad6286e886172c3e086 100644 (file)
@@ -894,12 +894,12 @@ template <typename _Tp, typename _Mp, typename _Abi, size_t _Np>
     class _SimdCastType2
     {
       using _Ap = __intrinsic_type_t<_Tp, _Np>;
-      using _B = __vector_type_t<_Tp, _Np>;
+      using _Bp = __vector_type_t<_Tp, _Np>;
       _SimdMember _M_data;
 
     public:
       _SimdCastType2(_Ap __a) : _M_data(__vector_bitcast<_Tp>(__a)) {}
-      _SimdCastType2(_B __b) : _M_data(__b) {}
+      _SimdCastType2(_Bp __b) : _M_data(__b) {}
       operator _SimdMember() const { return _M_data; }
     };
 
index 74824873734941bed121143095f7676568c674fc..305d7a9fa54886c0227660e26a9d6c86f8a83fca 100644 (file)
@@ -55,10 +55,10 @@ template <typename _TV,
 
 // }}}
 // __interleave128_lo {{{
-template <typename _Ap, typename _B, typename _Tp = common_type_t<_Ap, _B>,
+template <typename _Ap, typename _Bp, typename _Tp = common_type_t<_Ap, _Bp>,
          typename _Trait = _VectorTraits<_Tp>>
   _GLIBCXX_SIMD_INTRINSIC constexpr _Tp
-  __interleave128_lo(const _Ap& __av, const _B& __bv)
+  __interleave128_lo(const _Ap& __av, const _Bp& __bv)
   {
     const _Tp __a(__av);
     const _Tp __b(__bv);