public inbox for libstdc++-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r11-7476] libstdc++: Don't use reserved identifiers in simd headers
@ 2021-03-03 12:21 Rainer Orth
  0 siblings, 0 replies; only message in thread
From: Rainer Orth @ 2021-03-03 12:21 UTC (permalink / raw)
  To: gcc-cvs, libstdc++-cvs

https://gcc.gnu.org/g:a7267237371cc978fa6e0485446af11c60e4b102

commit r11-7476-ga7267237371cc978fa6e0485446af11c60e4b102
Author: Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
Date:   Wed Mar 3 13:16:35 2021 +0100

    libstdc++: Don't use reserved identifiers in simd headers
    
    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.

Diff:
---
 libstdc++-v3/include/experimental/bits/simd.h         | 12 ++++++------
 libstdc++-v3/include/experimental/bits/simd_builtin.h |  4 ++--
 libstdc++-v3/include/experimental/bits/simd_x86.h     |  4 ++--
 3 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/libstdc++-v3/include/experimental/bits/simd.h b/libstdc++-v3/include/experimental/bits/simd.h
index c452778832f..59ddf3cc958 100644
--- a/libstdc++-v3/include/experimental/bits/simd.h
+++ b/libstdc++-v3/include/experimental/bits/simd.h
@@ -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>{};
diff --git a/libstdc++-v3/include/experimental/bits/simd_builtin.h b/libstdc++-v3/include/experimental/bits/simd_builtin.h
index 7f728a10488..e986ee91620 100644
--- a/libstdc++-v3/include/experimental/bits/simd_builtin.h
+++ b/libstdc++-v3/include/experimental/bits/simd_builtin.h
@@ -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; }
     };
 
diff --git a/libstdc++-v3/include/experimental/bits/simd_x86.h b/libstdc++-v3/include/experimental/bits/simd_x86.h
index 74824873734..305d7a9fa54 100644
--- a/libstdc++-v3/include/experimental/bits/simd_x86.h
+++ b/libstdc++-v3/include/experimental/bits/simd_x86.h
@@ -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);


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-03-03 12:21 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-03 12:21 [gcc r11-7476] libstdc++: Don't use reserved identifiers in simd headers Rainer Orth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).