https://gcc.gnu.org/bugzilla/show_bug.cgi?id=115897

Matthias Kretz (Vir) <mkretz at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |---

--- Comment #7 from Matthias Kretz (Vir) <mkretz at gcc dot gnu.org> ---
Thank you! Sadly, that doesn't seem to be enough.
Here's another variation reduced from the original source after rebuilding
trunk (https://compiler-explorer.com/z/vzeab64Td):

---------------------------------------------------
namespace std
{
  template <typename _Tp, typename _Up>
    inline constexpr bool is_same_v = __is_same(_Tp, _Up);
}

namespace simd
{
  template <typename _Tp>
    inline constexpr int __width_of = 1;

  template <typename _Tp>
    requires requires { _Tp{}[0]; }
    inline constexpr int __width_of<_Tp> = sizeof(_Tp) / sizeof(_Tp{}[0]);

  template <typename _Tp>
    using _Vp [[gnu::vector_size(16)]] = _Tp;

  static_assert(__width_of<_Vp<float>> == 4); // OK
  static_assert(not std::is_same_v<float, _Vp<float>>); // OK

  template <typename _Tp>
    struct __traits
    {
      using _SimdMember = _Vp<_Tp>;
      static_assert(sizeof(_SimdMember) == sizeof(_Vp<_Tp>)); // OK
      static_assert(std::is_same_v<_SimdMember, _Vp<_Tp>>, "wrong1");
      static_assert(__width_of<_Vp<_Tp>> == 4); // OK
      static_assert(__width_of<_SimdMember> == 4, "wrong2");

      template <typename _Arg>
        static constexpr bool _S_is_simd_ctor_arg = std::is_same_v<_Arg,
_SimdMember>;

      static_assert(not _S_is_simd_ctor_arg<_Tp>, "wrong3");
    };

  __traits<float> test = {};
}  // namespace simd
---------------------------------------------------

The three 'static_assert' printing 'wrong[123]' should not fail. They don't
fail with GCC 13.

Reply via email to