PR c++/19980
* decl.c (start_preparsed_function): Robustify.
* g++.dg/template/redecl3.C: New test.
From-SVN: r96872
+2005-03-22 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ PR c++/19980
+ * decl.c (start_preparsed_function): Robustify.
+
2005-03-22 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c++/20499
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);
+ {
+ /* FIXME: Handle error_mark_node more gracefully. */
+ 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;
+2005-03-22 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+ PR c++/19980
+ * g++.dg/template/redecl3.C: New test.
+
2005-03-22 Volker Reichelt <reichelt@igpm.rwth-aachen.de>
PR c++/20499
--- /dev/null
+// PR c++/19980
+// Origin: Volker Reichelt <reichelt@igpm.rwth-aachen.de>
+
+// { dg-do compile }
+
+int foo; // { dg-error "previous declaration" }
+template<int> void foo() {} // { dg-error "redeclared" }