The following invalid code snippet triggers an ICE on mainline and 4.1 branch: =================================================== template<void> void foo(); void bar() { foo<0>(); } =================================================== bug.cc:1: error: 'void' is not a valid type for a template constant parameter bug.cc: In function 'void bar()': bug.cc:2: internal compiler error: tree check: expected tree_list, have error_mark in type_unification_real, at cp/pt.c:9791 Please submit a full bug report, [etc.] This is fallout from PR 27668.
Subject: Bug 28641 Author: lmillward Date: Wed Aug 9 18:43:06 2006 New Revision: 116043 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=116043 Log: 2006-08-09 Lee Millward <lee.millward@codesourcery.com> PR c++/28637 * pt.c (coerce_template_parms): Copy across the invalid template arguments to the new template inner arguments. (retrieve_specialization): Robustify. * g++.dg/template/void3.C: New test. PR c++/28638 * pt.c (coerce_template_template_parms): Robustify. * g++.dg/template/void4.C: New test. PR c++/28639 * error.c (dump_template_parms): Robustify. PR c++/28640 * pt.c (redeclare_class_template): Robustify * g++.dg/template/void5.C: New test. PR c++/28641 * pt.c (type_unification_real): Robustify. Added: trunk/gcc/testsuite/g++.dg/template/void3.C trunk/gcc/testsuite/g++.dg/template/void4.C trunk/gcc/testsuite/g++.dg/template/void5.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/error.c trunk/gcc/cp/pt.c trunk/gcc/testsuite/ChangeLog
Partially fixed on mainline, the testcase now ICE's in the same place as PR 24791.
Subject: Bug 28641 Author: lmillward Date: Thu Aug 10 19:18:37 2006 New Revision: 116068 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=116068 Log: PR c++/28594 PR c++/28637 PR c++/28638 PR c++/28639 PR c++/28640 PR c++/28641 Revert: 2006-07-28 Lee Millward <lee.millward@codesourcery.com> PR c++/27668 PR c++/27962 * pt.c (process_template_parm) Store invalid template parameters as error_mark_node in the paramater list. (push_inline_template_parms_recursive): Handle invalid template parameters. (comp_template_parms): Likewise. (check_default_tmpl_args): Likewise. (coerce_template_template_parms): Likewise. (coerce_template_parms): Likewise. (mangle_class_name_for_template): Likewise. (tsubst_template_parms): Likewise. * error.c (dump_template_argument_list): Likewise. * g++.dg/template/crash54.C: New test. * g++.dg/template/nontype16.C: New test. * g++.dg/template/nontype5.C: Adjust error markers Removed: branches/gcc-4_1-branch/gcc/testsuite/g++.dg/template/crash54.C branches/gcc-4_1-branch/gcc/testsuite/g++.dg/template/nontype16.C Modified: branches/gcc-4_1-branch/gcc/cp/ChangeLog branches/gcc-4_1-branch/gcc/cp/error.c branches/gcc-4_1-branch/gcc/cp/pt.c branches/gcc-4_1-branch/gcc/testsuite/ChangeLog branches/gcc-4_1-branch/gcc/testsuite/g++.dg/template/nontype5.C
Fixed on the 4.1 branch by the reversal of the patch for PR 27668 so removing the 4.1 regression marker.
Confirmed as reproduced by Lee.
This doesn't ICE for me with current mainline: bug.cc:1: error: 'void' is not a valid type for a template constant parameter void bar() bug.cc:2: error: no matching function for call to 'foo()' Can anyone else confirm this?
Been fixed since at least "4.2.0 20060826".
I had meant to close this as fixed the last time.