OSDN Git Service

PR c++/43621
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 6 Apr 2010 16:10:47 +0000 (16:10 +0000)
committerMasaki Muranaka <monaka@monami-software.com>
Sun, 23 May 2010 00:45:35 +0000 (09:45 +0900)
* pt.c (maybe_update_decl_type): Check the return value from
push_scope.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@158006 138bc75d-0d04-0410-961f-82ee72b054a4

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

index ee75c46..9a2f01d 100644 (file)
@@ -1,3 +1,9 @@
+2010-04-06  Jason Merrill  <jason@redhat.com>
+
+       PR c++/43621
+       * pt.c (maybe_update_decl_type): Check the return value from
+       push_scope.
+
 2010-04-01  Jason Merrill  <jason@redhat.com>
 
        * decl.c (next_initializable_field): No longer static.
index 3e2927c..0bd55e1 100644 (file)
@@ -3720,15 +3720,17 @@ maybe_update_decl_type (tree orig_type, tree scope)
         TYPENAME_TYPEs and SCOPE_REFs that were previously dependent.  */
       tree args = current_template_args ();
       tree auto_node = type_uses_auto (type);
+      tree pushed;
       if (auto_node)
        {
          tree auto_vec = make_tree_vec (1);
          TREE_VEC_ELT (auto_vec, 0) = auto_node;
          args = add_to_template_args (args, auto_vec);
        }
-      push_scope (scope);
+      pushed = push_scope (scope);
       type = tsubst (type, args, tf_warning_or_error, NULL_TREE);
-      pop_scope (scope);
+      if (pushed)
+       pop_scope (scope);
     }
 
   if (type == error_mark_node)
index 22f8934..d1acb39 100644 (file)
@@ -1,3 +1,8 @@
+2010-04-06  Jason Merrill  <jason@redhat.com>
+
+       PR c++/43621
+       * g++.dg/template/error-recovery2.C: New.
+
 2010-04-06  Jan Hubicka  <jh@suse.czpli
 
        PR tree-optimization/42906