pt.c (tsubst_expr, [...]): Don't process if tsubsting fails.
authorNathan Sidwell <nathan@codesourcery.com>
Thu, 5 Oct 2000 08:31:15 +0000 (08:31 +0000)
committerNathan Sidwell <nathan@gcc.gnu.org>
Thu, 5 Oct 2000 08:31:15 +0000 (08:31 +0000)
* pt.c (tsubst_expr, DECL_STMT case): Don't process if
tsubsting fails.

From-SVN: r36720

gcc/cp/ChangeLog
gcc/cp/pt.c

index 508cd1eaf1efb3715b991241c7d8050e00c1638b..960f17d03098ccdf88309f69f34715710e361b45 100644 (file)
@@ -1,3 +1,8 @@
+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.
index e3357a0bce0cc1598509dfdf7ab35ed68ac341e6..171250e5757c46f7ba5a90b8f39f0a49ec6e4e36 100644 (file)
@@ -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;
       }