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]

C++ PATCH: PR 17929 on mainline


Even after an update, g++.dg/parse/qualified2.C did not FAIL for me --
although the DejaGNU logs did show an ICE.  It looks like DejaGNU
treated that as an acceptable error message at the line in question,
which is supposed to have an error message.

Anyhow, this patch, backported from the 3.4 branch, fixes the problem.
Tested on i686-pc-linux-gnu, applied on the mainline.

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

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

	PR c++/17929
	* 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]