This is the mail archive of the gcc-patches@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]
Other format: [Raw text]

PATCH: Fix 3.4 error message regressions


Phil's tester noticed that one of my recent patches triggered a couple
of error-message regressions on the 3.4 branch.  

Fixed with the attached obvious patch, tested on i686-pc-linux-gnu,
committed on the 3.4 branch.  (On the mainline, we don't go down quite
the same code path, so this change does not -- yet, at least -- appear
to be necessary.)

--
Mark Mitchell
CodeSourcery, LLC
mark@codesourcery.com

2004-10-11  Mark Mitchell  <mark@codesourcery.com>

	* decl2.c (finish_anon_union): Robustify.

Index: decl2.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/decl2.c,v
retrieving revision 1.695.4.9
diff -c -5 -p -r1.695.4.9 decl2.c
*** decl2.c	25 Jun 2004 21:58:54 -0000	1.695.4.9
--- decl2.c	11 Oct 2004 14:41:43 -0000
*************** build_anon_union_vars (tree object)
*** 1201,1213 ****
     is nonzero if this union is not declared static.  */
  
  void
  finish_anon_union (tree anon_union_decl)
  {
!   tree type = TREE_TYPE (anon_union_decl);
    tree main_decl;
!   bool public_p = TREE_PUBLIC (anon_union_decl);
  
    /* The VAR_DECL's context is the same as the TYPE's context.  */
    DECL_CONTEXT (anon_union_decl) = DECL_CONTEXT (TYPE_NAME (type));
    
    if (TYPE_FIELDS (type) == NULL_TREE)
--- 1201,1219 ----
     is nonzero if this union is not declared static.  */
  
  void
  finish_anon_union (tree anon_union_decl)
  {
!   tree type;
    tree main_decl;
!   bool public_p;
! 
!   if (anon_union_decl == error_mark_node)
!     return;
! 
!   type = TREE_TYPE (anon_union_decl);
!   public_p = TREE_PUBLIC (anon_union_decl);
  
    /* The VAR_DECL's context is the same as the TYPE's context.  */
    DECL_CONTEXT (anon_union_decl) = DECL_CONTEXT (TYPE_NAME (type));
    
    if (TYPE_FIELDS (type) == NULL_TREE)


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