From: Mark Mitchell Date: Sat, 29 Jan 2005 00:47:57 +0000 (+0000) Subject: re PR c++/19667 (ICE on (very trivial) invalid) X-Git-Tag: releases/gcc-4.0.0~1203 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ee921ddf2138f35cae582ef7fa13e22eaa9ece50;p=thirdparty%2Fgcc.git re PR c++/19667 (ICE on (very trivial) invalid) PR c++/19667 * g++.dg/template/crash32.C: New test. PR c++/19667 * pt.c (redeclare_class_template): Robustify. From-SVN: r94402 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index bb1ac4e787e6..077113c61dea 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2005-01-28 Mark Mitchell + + PR c++/19667 + * pt.c (redeclare_class_template): Robustify. + 2005-01-27 Steven Bosscher * decl.c (finish_case_label): Use SWITCH_STMT accessor macros diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index dc781b4afc81..176e6a3a9e92 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -3236,6 +3236,13 @@ redeclare_class_template (tree type, tree parms) type. */ return; + if (!parms) + { + error ("template specifiers not specified in declaration of %qD", + tmpl); + return; + } + parms = INNERMOST_TEMPLATE_PARMS (parms); tmpl_parms = DECL_INNERMOST_TEMPLATE_PARMS (tmpl); diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 647497a757b0..06c06d3a3d61 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2005-01-28 Mark Mitchell + + PR c++/19667 + * g++.dg/template/crash32.C: New test. + 2005-01-28 Ian Lance Taylor PR middle-end/16558 diff --git a/gcc/testsuite/g++.dg/template/crash32.C b/gcc/testsuite/g++.dg/template/crash32.C new file mode 100644 index 000000000000..a8363512e947 --- /dev/null +++ b/gcc/testsuite/g++.dg/template/crash32.C @@ -0,0 +1,9 @@ +// PR c++/19667 + +struct integral_constant { }; + +template +struct is_function : public integral_constant { }; // { dg-error "previous" } + +template<> +struct is_function : public integral_constant { }; // { dg-error "" }