Commit 3e9ac7e5 by Volker Reichelt Committed by Volker Reichelt

re PR c++/28110 (ICE with invalid template constant parameter)

	PR c++/28110
	* pt.c (unify) <case TEMPLATE_PARM_INDEX>: Check for invalid
	parameters.

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

From-SVN: r114885
parent 717f8053
2006-06-22 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c++/28110
* pt.c (unify) <case TEMPLATE_PARM_INDEX>: Check for invalid
parameters.
PR c++/28109
* rtti.c (get_tinfo_decl_dynamic): Robustify.
......
......@@ -10281,6 +10281,8 @@ unify (tree tparms, tree targs, tree parm, tree arg, int strict)
case TEMPLATE_PARM_INDEX:
tparm = TREE_VALUE (TREE_VEC_ELT (tparms, 0));
if (tparm == error_mark_node)
return 1;
if (TEMPLATE_PARM_LEVEL (parm)
!= template_decl_level (tparm))
......
2006-06-22 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c++/28110
* g++.dg/template/crash53.C: New test.
PR c++/28109
* g++.dg/rtti/incomplete1.C: New test.
// PR c++/28110
// { dg-do compile }
template<int> struct A {};
template<typename T> struct B
{
template<T I> B(A<I>); // { dg-error "template constant parameter" }
};
B<double> a=A<0>(); // { dg-error "non-scalar type" }
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