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

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

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

--- Comment #2 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
This boils down to:

template <typename T>
struct delete_ptr_hash
{
};

template <typename T>
struct hash_table
{
};

template <typename T>
struct uintset
{
  T values[1];
  struct traits : delete_ptr_hash <uintset>
  {
  };
  struct hash : hash_table <traits>
  {
    int foo ();
  };
  hash h;
};

template <typename T>
int
uintset<T>::hash::foo ()
{
  return sizeof (uintset::values);
}

uintset<int> s;
int x = s.h.foo ();

This is rejected by g++ up to 4.5.x, icc 13 and clang (all versions) and
accepted by gcc 4.6 and later and icc 16 and later.

Reply via email to