The code below causes an ICE in GCC 4.5.0.  It compiles fine in GCC 4.4.3.

$ g++ -save-temps -o crash crash.cpp
crash.cpp: In function ‘int main()’:
crash.cpp:23:22: internal compiler error: in dependent_type_p, at cp/pt.c:17404
Please submit a full bug report, ...


Output of g++ -v:

Using built-in specs.
COLLECT_GCC=g++
COLLECT_LTO_WRAPPER=/home/test/libexec/gcc/x86_64-unknown-linux-gnu/4.5.0/lto-wrapper
Target: x86_64-unknown-linux-gnu
Configured with: ./configure --prefix=/home/test --without-arch32
--without-cpu32 --with-arch64 --with-cpu64 --disable-multilib
Thread model: posix
gcc version 4.5.0 (GCC) 


Test Case:


template <typename T, 
                typename U,
                typename T::type V> 
class bad;

// partial specialization
// for T = U
template<typename T, 
                typename T::type V>
class bad<T, T, V>
{
public:
        static void foo() {}
};

struct dummy 
{
        typedef int type;
};

int main()
{
        bad<dummy, dummy, 0>::foo();
}


-- 
           Summary: ICE: dependent_type_p, at cp/pt.c:17404
           Product: gcc
           Version: 4.5.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: deligonul at gmail dot com
  GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: x86_64-unknown-linux-gnu


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43953

Reply via email to