OSDN Git Service

PR c++/43076
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 30 Mar 2010 22:34:02 +0000 (22:34 +0000)
committerMasaki Muranaka <monaka@monami-software.com>
Sun, 23 May 2010 00:39:41 +0000 (09:39 +0900)
* pt.c (push_template_decl_real): Deal better with running out of
scopes before running out of template parms.

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

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

index 2f6ae04..9138ee1 100644 (file)
@@ -1,5 +1,9 @@
 2010-03-30  Jason Merrill  <jason@redhat.com>
 
+       PR c++/43076
+       * pt.c (push_template_decl_real): Deal better with running out of
+       scopes before running out of template parms.
+
        PR c++/41185
        PR c++/41786
        * parser.c (cp_parser_direct_declarator): Don't allow VLAs in
index a58dba2..a8e1b78 100644 (file)
@@ -4548,6 +4548,9 @@ push_template_decl_real (tree decl, bool is_friend)
 
            if (current == decl)
              current = ctx;
+           else if (current == NULL_TREE)
+             /* Can happen in erroneous input.  */
+             break;
            else
              current = (TYPE_P (current)
                         ? TYPE_CONTEXT (current)
index a561219..818dbde 100644 (file)
@@ -1,5 +1,8 @@
 2010-03-30  Jason Merrill  <jason@redhat.com>
 
+       PR c++/43076
+       * g++.dg/template/error-recovery1.C: New.
+
        PR c++/41786
        * g++.dg/parse/ambig5.C: New.