* decl.c (start_preparsed_function): Robustify.
* g++.dg/template/redecl3.C: New test.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@96872
138bc75d-0d04-0410-961f-
82ee72b054a4
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
* parser.c (cp_parser_class_head): Return NULL_TREE when
encountering a redefinition.
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
* g++.dg/parse/error16.C: Tweak error markers.
--- /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" }