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

            Bug ID: 63454
           Summary: [5 Regression] internal compiler error: canonical
                    types differ for identical types
           Product: gcc
           Version: 5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ai.azuma at gmail dot com

Created attachment 33645
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=33645&action=edit
Output of -v option and preprocessed file

The following valid code causes an ICE with GCC 5.0.0 20140928.

//=======================================================
template<typename T>
struct A
{
  typedef T type;
};

template<typename T>
struct B
{};

template<typename T>
B<typename A<T const>::type>
f(T const &)
{}

template<typename CharT>
struct X
{
  typedef CharT char_type;

  void memfun()
  {
    char_type const c[1] = { static_cast<char_type>(0) };
    f(c);
  }
};

template<typename CharT>
struct Y
{
  typedef CharT char_type;

  void memfun()
  {
    char_type const c[1] = { static_cast<char_type>(0) };
    f(c);
  }
};

template struct X<char>;
template struct Y<char>;
//=======================================================

Note that the above code compiles successfully with 4.9.2 20140924 and 4.8.4
20140925. The reproducer originally comes from a Boost.Log 1.56.0 source file.

Reply via email to