This is the mail archive of the mailing list for the GCC project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: (C++) Patch to elaborated-type-specifier handling

Jason Merrill <> writes:
> 	* decl2.c (handle_class_head): Generate a TYPENAME_TYPE for
> 	'class This::Inherited'.

Since it's been nearly a week since this broke decl5.C, I came up with
this patch to fix it.  handle_class_head always pushes a scope.
(With the mandatory Random Whitespace Change.)

Your previous patch didn't specify on what host you tested your
patch, so I'm unable to work out why you didn't see this failure.

Tested on x86-linux.

- Geoffrey Keating <>

2000-09-17  Geoffrey Keating  <>

	* decl2.c (handle_class_head): Always push some scope even
	in the error case.

Index: gcc/cp/decl2.c
RCS file: /cvs/gcc/egcs/gcc/cp/decl2.c,v
retrieving revision 1.398
diff -u -p -r1.398 decl2.c
--- decl2.c	2000/09/17 07:38:19	1.398
+++ decl2.c	2000/09/17 08:24:32
@@ -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));

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]