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] Random tidying


Hi,
I've installed this patch which tidies up some random stuff I found
wandering the tree.

built & tested on i686-pc-linux-gnu.

nathan
-- 
Dr Nathan Sidwell   ::   http://www.codesourcery.com   ::   CodeSourcery LLC
         'But that's a lie.' - 'Yes it is. What's your point?'
nathan@codesourcery.com : http://www.cs.bris.ac.uk/~nathan/ : nathan@acm.org
Index: cp/call.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/call.c,v
retrieving revision 1.299
diff -c -3 -p -r1.299 call.c
*** call.c	2001/12/18 11:51:05	1.299
--- call.c	2001/12/26 18:40:10
*************** build_user_type_conversion_1 (totype, ex
*** 2376,2384 ****
    /* We represent conversion within a hierarchy using RVALUE_CONV and
       BASE_CONV, as specified by [over.best.ics]; these become plain
       constructor calls, as specified in [dcl.init].  */
!   if (IS_AGGR_TYPE (fromtype) && IS_AGGR_TYPE (totype)
!       && DERIVED_FROM_P (totype, fromtype))
!     abort ();
  
    if (IS_AGGR_TYPE (totype))
      ctors = lookup_fnfields (TYPE_BINFO (totype),
--- 2376,2383 ----
    /* We represent conversion within a hierarchy using RVALUE_CONV and
       BASE_CONV, as specified by [over.best.ics]; these become plain
       constructor calls, as specified in [dcl.init].  */
!   my_friendly_assert (!IS_AGGR_TYPE (fromtype) || !IS_AGGR_TYPE (totype)
! 		      || !DERIVED_FROM_P (totype, fromtype), 20011226);
  
    if (IS_AGGR_TYPE (totype))
      ctors = lookup_fnfields (TYPE_BINFO (totype),
*************** build_user_type_conversion_1 (totype, ex
*** 2400,2410 ****
        t = build_int_2 (0, 0);
        TREE_TYPE (t) = build_pointer_type (totype);
        args = build_tree_list (NULL_TREE, expr);
!       if (DECL_HAS_IN_CHARGE_PARM_P (OVL_CURRENT (ctors))
! 	  || DECL_HAS_VTT_PARM_P (OVL_CURRENT (ctors)))
! 	/* We should never try to call the abstract or base constructor
! 	   from here.  */
! 	abort ();
        args = tree_cons (NULL_TREE, t, args);
      }
    for (; ctors; ctors = OVL_NEXT (ctors))
--- 2399,2409 ----
        t = build_int_2 (0, 0);
        TREE_TYPE (t) = build_pointer_type (totype);
        args = build_tree_list (NULL_TREE, expr);
!       /* We should never try to call the abstract or base constructor
! 	 from here.  */
!       my_friendly_assert (!DECL_HAS_IN_CHARGE_PARM_P (OVL_CURRENT (ctors))
! 			  && !DECL_HAS_VTT_PARM_P (OVL_CURRENT (ctors)),
! 			  20011226);
        args = tree_cons (NULL_TREE, t, args);
      }
    for (; ctors; ctors = OVL_NEXT (ctors))
Index: cp/cvt.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/cvt.c,v
retrieving revision 1.110
diff -c -3 -p -r1.110 cvt.c
*** cvt.c	2001/12/18 03:35:26	1.110
--- cvt.c	2001/12/26 18:40:37
*************** convert_to_reference (reftype, expr, con
*** 485,492 ****
        intype = TREE_TYPE (expr);
      }
  
!   if (TREE_CODE (intype) == REFERENCE_TYPE)
!     my_friendly_abort (364);
  
    intype = TYPE_MAIN_VARIANT (intype);
  
--- 485,491 ----
        intype = TREE_TYPE (expr);
      }
  
!   my_friendly_assert (TREE_CODE (intype) != REFERENCE_TYPE, 364);
  
    intype = TYPE_MAIN_VARIANT (intype);
  
Index: cp/semantics.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/semantics.c,v
retrieving revision 1.240
diff -c -3 -p -r1.240 semantics.c
*** semantics.c	2001/12/18 13:30:30	1.240
--- semantics.c	2001/12/26 18:51:47
*************** setup_vtbl_ptr (member_init_list, base_i
*** 1157,1166 ****
       tree base_init_list;
  {
    my_friendly_assert (doing_semantic_analysis_p (), 19990919);
! 
!   /* If we've already done this, break.  */
!   if (vtbls_set_up_p)
!     abort ();
  
    if (processing_template_decl)
      add_stmt (build_min_nt (CTOR_INITIALIZER,
--- 1157,1163 ----
       tree base_init_list;
  {
    my_friendly_assert (doing_semantic_analysis_p (), 19990919);
!   my_friendly_assert (!vtbls_set_up_p, 20011220);
  
    if (processing_template_decl)
      add_stmt (build_min_nt (CTOR_INITIALIZER,
Index: cp/pt.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/pt.c,v
retrieving revision 1.566
diff -c -3 -p -r1.566 pt.c
*** pt.c	2001/12/18 14:13:44	1.566
--- pt.c	2001/12/28 23:24:05
*************** lookup_template_class (d1, arglist, in_d
*** 3982,3988 ****
  	  arg_depth = TMPL_ARGS_DEPTH (arglist);
  	}
  
!       /* Now we should enough arguments.  */
        my_friendly_assert (parm_depth == arg_depth, 0);
        
        /* From here on, we're only interested in the most general
--- 3990,3996 ----
  	  arg_depth = TMPL_ARGS_DEPTH (arglist);
  	}
  
!       /* Now we should have enough arguments.  */
        my_friendly_assert (parm_depth == arg_depth, 0);
        
        /* From here on, we're only interested in the most general

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