Commit f1cc0515 by Volker Reichelt Committed by Volker Reichelt

re PR c++/22233 (ICE with wrong number of template parameters)

	PR c++/22233
	* pt.c (push_template_decl_real): Return error_mark_node if the
	number of template parameters does not match previous definition.

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

From-SVN: r103339
parent dff1b563
2005-08-22 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c++/22233
* pt.c (push_template_decl_real): Return error_mark_node if the
number of template parameters does not match previous definition.
2005-08-22 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c++/23089
* decl.c (require_complete_types_for_parms): Mark incomplete types
as invalid.
......
......@@ -3109,6 +3109,7 @@ push_template_decl_real (tree decl, int is_friend)
error ("got %d template parameters for %q#T",
TREE_VEC_LENGTH (a), current);
error (" but %d required", TREE_VEC_LENGTH (t));
return error_mark_node;
}
/* Perhaps we should also check that the parms are used in the
......
2005-08-22 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c++/22233
* g++.dg/template/param1.C: New test.
2005-08-22 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c++/23089
* g++.dg/other/incomplete1.C: New test.
......
// PR c++/22233
// Origin: Volker Reichelt <reichelt@igpm.rwth-aachen.de>
// { dg-do compile }
template<int> struct A
{
A();
};
template<int N, char> A<N>::A() {} // { dg-error "got 2|but 1 required" }
A<0> 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