Commit 728da672 by Volker Reichelt Committed by Volker Reichelt

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
parent 3e9ac7e5
2006-06-22 Volker Reichelt <reichelt@igpm.rwth-aachen.de> 2006-06-22 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c++/28111
* pt.c (determine_specialization): Check for invalid decls.
PR c++/28110 PR c++/28110
* pt.c (unify) <case TEMPLATE_PARM_INDEX>: Check for invalid * pt.c (unify) <case TEMPLATE_PARM_INDEX>: Check for invalid
parameters. parameters.
......
...@@ -1354,7 +1354,7 @@ determine_specialization (tree template_id, ...@@ -1354,7 +1354,7 @@ determine_specialization (tree template_id,
*targs_out = NULL_TREE; *targs_out = NULL_TREE;
if (template_id == error_mark_node) if (template_id == error_mark_node || decl == error_mark_node)
return error_mark_node; return error_mark_node;
fns = TREE_OPERAND (template_id, 0); fns = TREE_OPERAND (template_id, 0);
......
2006-06-22 Volker Reichelt <reichelt@igpm.rwth-aachen.de> 2006-06-22 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c++/28111
* g++.dg/template/friend43.C: New test.
PR c++/28110 PR c++/28110
* g++.dg/template/crash53.C: New test. * g++.dg/template/crash53.C: New test.
// 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;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment