This is the mail archive of the gcc-bugs@gcc.gnu.org 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]

PATCH for decl.c



Jason --

1998-05-26  Martin v. Löwis  <loewis@informatik.hu-berlin.de>

	* decl.c (grokdeclarator): Put typedefs on the type's obstack.

This patch was slightly broken.  Here's a fix.  OK?
 
-- 
Mark Mitchell 			mark@markmitchell.com
Mark Mitchell Consulting	http://www.markmitchell.com

1998-05-26  Mark Mitchell  <mark@markmitchell.com>

	* decl.c (grokdeclarator): Don't try to use TYPE_OBSTACK on an
	error_mark_node.
	
Index: decl.c
===================================================================
RCS file: /egcs/carton/cvsfiles/egcs/gcc/cp/decl.c,v
retrieving revision 1.124
diff -c -p -r1.124 decl.c
*** decl.c	1998/05/26 20:59:33	1.124
--- decl.c	1998/05/27 06:06:24
*************** grokdeclarator (declarator, declspecs, d
*** 9590,9598 ****
  	{
  	  /* Make sure this typedef lives as long as its type,
  	     since it might be used as a template parameter. */
! 	  push_obstacks (TYPE_OBSTACK (type), TYPE_OBSTACK (type));
  	  decl = build_decl (TYPE_DECL, declarator, type);
! 	  pop_obstacks ();
  	}
  
        /* If the user declares "struct {...} foo" then `foo' will have
--- 9590,9600 ----
  	{
  	  /* Make sure this typedef lives as long as its type,
  	     since it might be used as a template parameter. */
! 	  if (type != error_mark_node)
! 	    push_obstacks (TYPE_OBSTACK (type), TYPE_OBSTACK (type));
  	  decl = build_decl (TYPE_DECL, declarator, type);
! 	  if (type != error_mark_node)
! 	    pop_obstacks ();
  	}
  
        /* If the user declares "struct {...} foo" then `foo' will have


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