aboutsummaryrefslogtreecommitdiff
path: root/gcc/cp
diff options
context:
space:
mode:
authorVolker Reichelt <reichelt@igpm.rwth-aachen.de>2005-03-22 15:07:04 +0000
committerVolker Reichelt <reichelt@gcc.gnu.org>2005-03-22 15:07:04 +0000
commit11e9773775ae83d26e8e6e39b5198c2c86cdb5b7 (patch)
tree4ed612665b7cb33449ed2c352e9a0f7652c23c60 /gcc/cp
parent0f3744f8c2816d6f681b7b93784c634e1f8f34c2 (diff)
downloadgcc-11e9773775ae83d26e8e6e39b5198c2c86cdb5b7.zip
gcc-11e9773775ae83d26e8e6e39b5198c2c86cdb5b7.tar.gz
gcc-11e9773775ae83d26e8e6e39b5198c2c86cdb5b7.tar.bz2
re PR c++/19980 (ICE on invalid template declaration)
PR c++/19980 * decl.c (start_preparsed_function): Robustify. * g++.dg/template/redecl3.C: New test. From-SVN: r96872
Diffstat (limited to 'gcc/cp')
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/decl.c7
2 files changed, 11 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index bb0c547..73dd59f 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,10 @@
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.
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 4887080..1c4568d 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -10009,7 +10009,12 @@ start_preparsed_function (tree decl1, tree attrs, int flags)
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;