aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNathan Sidwell <nathan@codesourcery.com>2000-10-05 08:31:15 +0000
committerNathan Sidwell <nathan@gcc.gnu.org>2000-10-05 08:31:15 +0000
commitce2e5191bc52312239c22129e84e0b97ab00994f (patch)
tree0d96c6d8f519c8b7e450b7d0d5d3d508a9c35710
parent79cc53125a0050fdd2390f2fd53e949e80fbfe1b (diff)
downloadgcc-ce2e5191bc52312239c22129e84e0b97ab00994f.zip
gcc-ce2e5191bc52312239c22129e84e0b97ab00994f.tar.gz
gcc-ce2e5191bc52312239c22129e84e0b97ab00994f.tar.bz2
pt.c (tsubst_expr, [...]): Don't process if tsubsting fails.
* pt.c (tsubst_expr, DECL_STMT case): Don't process if tsubsting fails. From-SVN: r36720
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/pt.c25
2 files changed, 19 insertions, 11 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 508cd1e..960f17d 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,10 @@
2000-10-05 Nathan Sidwell <nathan@codesourcery.com>
+ * pt.c (tsubst_expr, DECL_STMT case): Don't process if
+ tsubsting fails.
+
+2000-10-05 Nathan Sidwell <nathan@codesourcery.com>
+
* spew.c (frob_id): New static function.
(frob_opname): Use it.
(yylex): Use it.
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index e3357a0..171250e 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -7145,17 +7145,20 @@ tsubst_expr (t, args, complain, in_decl)
init = DECL_INITIAL (decl);
decl = tsubst (decl, args, complain, in_decl);
init = tsubst_expr (init, args, complain, in_decl);
- if (init)
- DECL_INITIAL (decl) = error_mark_node;
- /* By marking the declaration as instantiated, we avoid
- trying to instantiate it. Since instantiate_decl can't
- handle local variables, and since we've already done
- all that needs to be done, that's the right thing to
- do. */
- if (TREE_CODE (decl) == VAR_DECL)
- DECL_TEMPLATE_INSTANTIATED (decl) = 1;
- maybe_push_decl (decl);
- cp_finish_decl (decl, init, NULL_TREE, 0);
+ if (decl != error_mark_node)
+ {
+ if (init)
+ DECL_INITIAL (decl) = error_mark_node;
+ /* By marking the declaration as instantiated, we avoid
+ trying to instantiate it. Since instantiate_decl can't
+ handle local variables, and since we've already done
+ all that needs to be done, that's the right thing to
+ do. */
+ if (TREE_CODE (decl) == VAR_DECL)
+ DECL_TEMPLATE_INSTANTIATED (decl) = 1;
+ maybe_push_decl (decl);
+ cp_finish_decl (decl, init, NULL_TREE, 0);
+ }
}
return decl;
}