+2005-09-02 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.
+ * decl.c (start_function): Handle error_mark_node returned by
+ push_template_decl.
+
2005-09-02 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
Backport:
class scope, current_class_type will be NULL_TREE until set above
by push_nested_class.) */
if (processing_template_decl)
- decl1 = push_template_decl (decl1);
+ {
+ tree newdecl1 = push_template_decl (decl1);
+ if (newdecl1 != error_mark_node)
+ decl1 = newdecl1;
+ }
/* We are now in the scope of the function being defined. */
current_function_decl = decl1;
error ("got %d template parameters for `%#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-09-02 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ PR c++/22233
+ * g++.dg/template/param1.C: New test.
+
2005-09-02 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
Backport: