re PR c++/28111 (ICE with invalid friend in template class)

PR c++/28111
	* pt.c (determine_specialization): Check for invalid decls.

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

From-SVN: r114887
This commit is contained in:
Volker Reichelt 2006-06-22 09:55:42 +00:00 committed by Volker Reichelt
parent 3e9ac7e525
commit 728da67271
4 changed files with 18 additions and 1 deletions

View File

@ -1,5 +1,8 @@
2006-06-22 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c++/28111
* pt.c (determine_specialization): Check for invalid decls.
PR c++/28110
* pt.c (unify) <case TEMPLATE_PARM_INDEX>: Check for invalid
parameters.

View File

@ -1354,7 +1354,7 @@ determine_specialization (tree template_id,
*targs_out = NULL_TREE;
if (template_id == error_mark_node)
if (template_id == error_mark_node || decl == error_mark_node)
return error_mark_node;
fns = TREE_OPERAND (template_id, 0);

View File

@ -1,5 +1,8 @@
2006-06-22 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c++/28111
* g++.dg/template/friend43.C: New test.
PR c++/28110
* g++.dg/template/crash53.C: New test.

View File

@ -0,0 +1,11 @@
// PR c++/28111
// { dg-do compile }
template<typename> void foo();
template<typename T> struct A
{
friend void foo<>(typename T::X); // { dg-error "not a class" }
};
A<int> a;