[Bug c++/35828] [C++0x] ICE on default template template parameter in template function

gcc at abeckmann dot de gcc-bugzilla@gcc.gnu.org
Mon Apr 20 17:51:00 GMT 2009



------- Comment #6 from gcc at abeckmann dot de  2009-04-20 17:51 -------
I stumbled across this ICE on a very similar testcase (on 4.3.4, 4.4.0, 4.5.0):

---------- 8< ----------
template < typename > struct A ;
template < template < typename > class = A >
void test ()
{
        test ();
}
---------- >8 ----------

=========== 4.4.0 ==========
$ x86_64-linux-gnu-g++-4.4.x -v -std=c++0x -c
ice-in-tsubst_decl-cp_pt_c_8101.min.ii

Using built-in specs.
Target: x86_64-unknown-linux-gnu
Configured with: ../gcc-4_4-branch/configure
--prefix=/opt/software/gcc-x86_64/gcc-4.4.x --program-suffix=-4.4.x
--enable-languages=c,c++ --enable-checking
Thread model: posix
gcc version 4.4.0 20090413 (prerelease) (GCC)
COLLECT_GCC_OPTIONS='-v' '-std=c++0x' '-c' '-shared-libgcc' '-mtune=generic'

/opt/software/gcc-x86_64/gcc-4.4.x/libexec/gcc/x86_64-unknown-linux-gnu/4.4.0/cc1plus
-fpreprocessed ice-in-tsubst_decl-cp_pt_c_8101.min.ii -quiet -dumpbase
ice-in-tsubst_decl-cp_pt_c_8101.min.ii -mtune=generic -auxbase
ice-in-tsubst_decl-cp_pt_c_8101.min -std=c++0x -version -o /tmp/ccAHdc5J.s
GNU C++ (GCC) version 4.4.0 20090413 (prerelease) (x86_64-unknown-linux-gnu)
        compiled by GNU C version 4.4.0 20090413 (prerelease), GMP version
4.2.2, MPFR version 2.3.1.
GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096
Compiler executable checksum: 4c95a5cf24794a394976148039ecc611
ice-in-tsubst_decl-cp_pt_c_8101.min.ii: In function ‘void test()’:
ice-in-tsubst_decl-cp_pt_c_8101.min.ii:1: internal compiler error: in
tsubst_decl, at cp/pt.c:8101
===========================

I also got the segmentation fault on this similar testcase, reported as bug
#39822 before seeing this report:

---------- 8< ----------
template < typename >
struct A ;
template < typename X, template < typename > class = A >
void test ( X )
{
        A < int > T ;
        test ( T ) ;
}
---------- >8 ----------


-- 


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



More information about the Gcc-bugs mailing list