Commit bf2f7328 by Volker Reichelt Committed by Volker Reichelt

re PR c++/19498 (ICE on invalid reference in template parameter)

	PR c++/19498
	* pt.c (tsubst_decl) <case TEMPLATE_DECL>: Return ERROR_MARK_NODE
	if substitution of template args did not succeed.

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

From-SVN: r102818
parent 8402b3e1
2005-08-06 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c++/19498
* pt.c (tsubst_decl) <case TEMPLATE_DECL>: Return ERROR_MARK_NODE
if substitution of template args did not succeed.
2005-08-06 Michael Matz <matz@suse.de> 2005-08-06 Michael Matz <matz@suse.de>
* method.c (use_thunk): Call init_insn_lengths. * method.c (use_thunk): Call init_insn_lengths.
......
...@@ -6224,6 +6224,8 @@ tsubst_decl (tree t, tree args, tsubst_flags_t complain) ...@@ -6224,6 +6224,8 @@ tsubst_decl (tree t, tree args, tsubst_flags_t complain)
: DECL_TI_ARGS (DECL_TEMPLATE_RESULT (t)); : DECL_TI_ARGS (DECL_TEMPLATE_RESULT (t));
full_args = tsubst_template_args (tmpl_args, args, full_args = tsubst_template_args (tmpl_args, args,
complain, in_decl); complain, in_decl);
if (full_args == error_mark_node)
return error_mark_node;
/* tsubst_template_args doesn't copy the vector if /* tsubst_template_args doesn't copy the vector if
nothing changed. But, *something* should have nothing changed. But, *something* should have
......
2005-08-06 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c++/19498
* g++.dg/template/instantiate7.C: New test.
2005-08-06 Joseph S. Myers <joseph@codesourcery.com> 2005-08-06 Joseph S. Myers <joseph@codesourcery.com>
PR c/23113 PR c/23113
......
// PR c++/19498
// Origin: Volker Reichelt <reichelt@igpm.rwth-aachen.de>
// { dg-do compile }
template<typename T> struct A
{
template<T&> struct B; // { dg-error "reference to void" }
};
A<void> a; // { dg-error "instantiated" }
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