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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Adjusted testcase without system headers:
namespace std {
  enum class byte : unsigned char {};
  constexpr byte
  operator| (byte __l, byte __r) noexcept
  { return (byte)(unsigned char)((unsigned)__l | (unsigned)__r); }
  constexpr byte&
  operator|= (byte& __l, byte __r) noexcept
  { return __l = __l | __r; }
}

struct A {
  std::byte data [6] {static_cast<std::byte> (0x00)};
  constexpr A (char ch) { data[ch/8] |= static_cast<std::byte>(0x01 << (ch %
8)); }
};

template <A chars> struct B { char ch; };

void
check (A a)
{
  for (int i = 0; i < 6; i++)
    if ((unsigned) a.data[i] != (i == 5 ? 4 : 0))
      __builtin_abort ();
}

using Bn = B<{'\n'}>;

template <A T>
void
foo ()
{
  check (T);
}

int
main ()
{
  foo<'*'> ();
  check (A{'*'});
}

Reply via email to