decl2.c (handle_class_head): Always push some scope even in the error case.
authorGeoff Keating <geoffk@cygnus.com>
Sun, 17 Sep 2000 09:39:20 +0000 (09:39 +0000)
committerGeoffrey Keating <geoffk@gcc.gnu.org>
Sun, 17 Sep 2000 09:39:20 +0000 (09:39 +0000)
* decl2.c (handle_class_head): Always push some scope even
in the error case.

From-SVN: r36467

gcc/cp/ChangeLog
gcc/cp/decl2.c

index 66e39759b8ee2cf0503b8b908a3a17786c5760e3..b0781e2deec88ccfb019447bc07802b20bf5ee6b 100644 (file)
@@ -1,3 +1,8 @@
+2000-09-17  Geoffrey Keating  <geoffk@cygnus.com>
+
+       * decl2.c (handle_class_head): Always push some scope even
+       in the error case.
+
 2000-09-16  Mark Mitchell  <mark@codesourcery.com>
 
        * cp-tree.h (struct cp_language_function): Remove
index b579f5976f8fe880141f5a98c11a4beb6f69bf22..a530c3284ee50fb6d5a13e764c39c29e7809f860 100644 (file)
@@ -5461,9 +5461,10 @@ handle_class_head (aggr, scope, id)
          /* According to the suggested resolution of core issue 180,
             'typename' is assumed after a class-key.  */
          decl = make_typename_type (scope, id, 1);
-         if (decl == error_mark_node)
-           return error_mark_node;
-         decl = TYPE_MAIN_DECL (decl);
+         if (decl != error_mark_node)
+           decl = TYPE_MAIN_DECL (decl);
+         else
+           decl = NULL_TREE;
        }
       else if (scope == current)
         {
@@ -5479,7 +5480,7 @@ handle_class_head (aggr, scope, id)
        cp_error ("no file-scope type named `%D'", id);
       
       /* Inject it at the current scope.  */
-      if (!decl)
+      if (! decl)
        decl = TYPE_MAIN_DECL (xref_tag (aggr, id, 1));
     }