re PR c++/10108 (tree checking ICE: expected var_decl, have error_mark in tsubst_decl)

PR c++/10108
	* pt.c (tsubst_decl) <TEMPLATE_DECL>: Add a check for
	error_mark_node.

	* g++.dg/template/crash7.C: New test.

From-SVN: r69409
This commit is contained in:
Kriang Lerdsuwanakij 2003-07-15 15:28:38 +00:00 committed by Kriang Lerdsuwanakij
parent aadf50ed06
commit caec1dc059
4 changed files with 26 additions and 0 deletions

View File

@ -1,3 +1,9 @@
2003-07-15 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
PR c++/10108
* pt.c (tsubst_decl) <TEMPLATE_DECL>: Add a check for
error_mark_node.
2003-07-14 Mark Mitchell <mark@codesourcery.com>
PR c++/11509

View File

@ -5837,6 +5837,8 @@ tsubst_decl (tree t, tree args, tree type, tsubst_flags_t complain)
else
{
tree new_decl = tsubst (decl, args, complain, in_decl);
if (new_decl == error_mark_node)
return error_mark_node;
DECL_TEMPLATE_RESULT (r) = new_decl;
DECL_TI_TEMPLATE (new_decl) = r;

View File

@ -1,3 +1,8 @@
2003-07-15 Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net>
PR c++/10108
* g++.dg/template/crash7.C: New test.
2003-07-15 Kazu Hirata <kazu@cs.umass.edu>
PR target/10795

View File

@ -0,0 +1,13 @@
// { dg-do compile }
// Origin: Volker Reichelt <reichelt@igpm.rwth-aachen.de>
// PR c++/10108: ICE in tsubst_decl for error due to non-existence
// nested type.
template <typename> struct A
{ // { dg-error "candidates" }
template <typename> A(typename A::X) {} // { dg-error "no type" }
};
A<void> a; // { dg-error "instantiated|no match" }