Created attachment 5547 [details] Source code (-save-temps)
Created attachment 5548 [details] Compiler output (-v -save-temps)
Confirmed. An ice-after-error. I don't have the time to reduce this at the moment, though, so I'll leave it to others. W.
Here's a reduced testcase. ======================================= template <int> struct A { typedef A<0> B; template <B> struct B {}; }; A<0> a; ======================================= With gcc 3.4.0 20031229 I get PR13797.cc:4: error: `struct A<0>' is not a valid type for a template constant parameter PR13797.cc:4: error: declaration of `template<int <anonymous> > template<void <anonymous> > struct A<<anonymous> >::B' PR13797.cc:3: error: conflicts with previous declaration `typedef struct A<0> A<<anonymous> >::B' PR13797.cc: In instantiation of `A<0>': PR13797.cc:7: instantiated from here PR13797.cc:3: error: `void' is not a valid type for a template constant parameter PR13797.cc:3: internal compiler error: in instantiate_class_template, at cp/pt.c:5384 Please submit a full bug report, If I replace line 4 with template <B> struct C {}; I get: PR13797.cc:4: error: `struct A<0>' is not a valid type for a template constant parameter PR13797.cc: In instantiation of `A<0>': PR13797.cc:7: instantiated from here PR13797.cc:4: error: `void' is not a valid type for a template constant parameter PR13797.cc:4: internal compiler error: tree check: expected record_type, have error_mark in tsubst_decl, at cp/pt.c:5917 Please submit a full bug report, GCC 2.95.3 issues a correct error message (thus we have a regression), 3.0 - 3.3.x go into an endless loop outputting the same error message over and over again.
Subject: Bug 13797 CVSROOT: /cvs/gcc Module name: gcc Changes by: lerdsuwa@gcc.gnu.org 2004-01-25 14:18:19 Modified files: gcc/cp : ChangeLog pt.c gcc/testsuite : ChangeLog Added files: gcc/testsuite/g++.dg/template: nontype4.C nontype5.C Log message: PR c++/13797 * pt.c (instantiate_class_template): Add an error_mark_node check. (tsubst_decl) <TEMPLATE_DECL case>: Likewise. * g++.dg/template/nontype4.C: New test. * g++.dg/template/nontype5.C: Likewise. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.3905&r2=1.3906 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/pt.c.diff?cvsroot=gcc&r1=1.818&r2=1.819 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.3417&r2=1.3418 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/nontype4.C.diff?cvsroot=gcc&r1=NONE&r2=1.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/nontype5.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
Subject: Bug 13797 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-3_4-branch Changes by: lerdsuwa@gcc.gnu.org 2004-01-25 14:30:27 Modified files: gcc/cp : ChangeLog pt.c gcc/testsuite : ChangeLog Added files: gcc/testsuite/g++.dg/template: nontype4.C nontype5.C Log message: PR c++/13797 * pt.c (instantiate_class_template): Add an error_mark_node check. (tsubst_decl) <TEMPLATE_DECL case>: Likewise. * g++.dg/template/nontype4.C: New test. * g++.dg/template/nontype5.C: Likewise. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.3892.2.11&r2=1.3892.2.12 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/pt.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.816.2.2&r2=1.816.2.3 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.3389.2.15&r2=1.3389.2.16 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/nontype4.C.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=NONE&r2=1.1.2.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/nontype5.C.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=NONE&r2=1.1.2.1
Fixed in 3.4 and main line by http://gcc.gnu.org/ml/gcc-patches/2004-01/msg02731.html
For 3.3 branch, a patch is available http://gcc.gnu.org/ml/gcc-patches/2004-01/msg02732.html however it only fixes the ICE exposed in the reduced testcases. The original testSeries.ii is preprocessed with GCC 3.4 libstdc++ headers that GCC 3.3 refuses to compile and produces additional ICE. This ICE is probably treated as won't fix.
Subject: Bug 13797 CVSROOT: /cvs/gcc Module name: gcc Branch: gcc-3_3-branch Changes by: lerdsuwa@gcc.gnu.org 2004-01-25 15:08:20 Modified files: gcc/cp : ChangeLog pt.c gcc/testsuite : ChangeLog Added files: gcc/testsuite/g++.dg/template: nontype4.C nontype5.C memclass1.C Log message: PR c++/13797 * pt.c (instantiate_class_template): Add an error_mark_node check. (tsubst_decl) <TEMPLATE_DECL case>: Likewise. Backport from mainline 2003-05-09 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net> PR c++/10555, c++/10576 * pt.c (lookup_template_class): Handle class template with multiple levels of parameters when one of the levels contain errors. * g++.dg/template/nontype4.C: New test. * g++.dg/template/nontype5.C: Likewise. * g++.dg/template/memclass1.C: New test. Patches: http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.3076.2.242&r2=1.3076.2.243 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/pt.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.635.2.41&r2=1.635.2.42 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.2261.2.352&r2=1.2261.2.353 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/nontype4.C.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=NONE&r2=1.1.4.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/nontype5.C.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=NONE&r2=1.1.4.1 http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/template/memclass1.C.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=NONE&r2=1.2.16.1
I'm closing this as fixed.