Source code below makes an ICE: g++-mp-4.5 -std=c++0x bug.cc bug.cc: In instantiation of 'derived<a>': bug.cc:20:16: instantiated from here bug.cc:9:1: internal compiler error: canonical types differ for identical types derived<a> and derived<a>
Source: struct a {}; template < typename T, typename ENCLOSING > struct base; template < typename... T > struct derived : public base< T, derived< T... > >... {}; template < typename... T> struct base< a, derived< T... > > { typedef derived< T... > Derived; }; int main() { derived< a > instance; } g++-mp-4.5 -v Using built-in specs. Target: i386-apple-darwin9 Configured with: ../gcc-4.5-20091001/configure --prefix=/opt/local --build=i386-apple-darwin9 --enable-languages=c,c++,objc,obj-c++ --libdir=/opt/local/lib/gcc45 --includedir=/opt/local/include/gcc45 --infodir=/opt/local/share/info --mandir=/opt/local/share/man --with-local-prefix=/opt/local --with-system-zlib --disable-nls --program-suffix=-mp-4.5 --with-gxx-include-dir=/opt/local/include/gcc45/c++/ --with-gmp=/opt/local --with-mpfr=/opt/local Thread model: posix gcc version 4.5.0 20091001 (experimental) (GCC) -- Summary: ICE on canonical types with variadic templates and CRTP Product: gcc Version: 4.5.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassigned at gcc dot gnu dot org ReportedBy: alban dot linard at gmail dot com GCC build triplet: i386-apple-darwin9 GCC host triplet: i386-apple-darwin9 GCC target triplet: i386-apple-darwin9 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41785