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] Boring reformatting


I've installed this patch which collects up some reformatting of pt.c

tested on i686-pc-linux-gnu

nathan
--
Nathan Sidwell    ::   http://www.codesourcery.com   ::     CodeSourcery LLC
         The voices in my head said this was stupid too
nathan@codesourcery.com    ::     http://www.planetfall.pwp.blueyonder.co.uk

2003-07-30  Nathan Sidwell  <nathan@codesourcery.com>

	* pt.c (coerce_template_template_parms, lookup_template_class,
	can_complete_type_without_circularity, instantiate_class_template,
	tsubst_decl, unify): Reformat.

Index: cp/pt.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/cp/pt.c,v
retrieving revision 1.738
diff -c -3 -p -r1.738 pt.c
*** cp/pt.c	25 Jul 2003 16:45:34 -0000	1.738
--- cp/pt.c	30 Jul 2003 18:00:30 -0000
*************** coerce_template_template_parms (tree par
*** 3371,3379 ****
  	    tree parmparm = DECL_INNERMOST_TEMPLATE_PARMS (parm);
  	    tree argparm = DECL_INNERMOST_TEMPLATE_PARMS (arg);
  
! 	    if (!coerce_template_template_parms (parmparm, argparm, 
! 					         complain, in_decl,
! 						 outer_args))
  	      return 0;
  	  }
  	  break;
--- 3371,3378 ----
  	    tree parmparm = DECL_INNERMOST_TEMPLATE_PARMS (parm);
  	    tree argparm = DECL_INNERMOST_TEMPLATE_PARMS (arg);
  
! 	    if (!coerce_template_template_parms
! 		(parmparm, argparm, complain, in_decl, outer_args))
  	      return 0;
  	  }
  	  break;
*************** coerce_template_template_parms (tree par
*** 3382,3390 ****
  	  /* The tsubst call is used to handle cases such as
  	       template <class T, template <T> class TT> class D;  
  	     i.e. the parameter list of TT depends on earlier parameters.  */
! 	  if (!same_type_p (tsubst (TREE_TYPE (parm), outer_args, 
! 				    complain, in_decl),
! 			    TREE_TYPE (arg)))
  	    return 0;
  	  break;
  	  
--- 3381,3389 ----
  	  /* The tsubst call is used to handle cases such as
  	       template <class T, template <T> class TT> class D;  
  	     i.e. the parameter list of TT depends on earlier parameters.  */
! 	  if (!same_type_p
! 	      (tsubst (TREE_TYPE (parm), outer_args, complain, in_decl),
! 	       TREE_TYPE (arg)))
  	    return 0;
  	  break;
  	  
*************** lookup_template_class (tree d1, 
*** 4135,4143 ****
  	       i > 0 && t != NULL_TREE;
  	       --i, t = TREE_CHAIN (t))
  	    {
! 	      tree a = coerce_template_parms (TREE_VALUE (t),
! 					      arglist, template,
! 	                                      complain, /*require_all_args=*/1);
  
  	      /* Don't process further if one of the levels fails.  */
  	      if (a == error_mark_node)
--- 4134,4142 ----
  	       i > 0 && t != NULL_TREE;
  	       --i, t = TREE_CHAIN (t))
  	    {
! 	      tree a = coerce_template_parms (TREE_VALUE (t), arglist,
! 					      template, complain,
! 					      /*require_all_args=*/1);
  
  	      /* Don't process further if one of the levels fails.  */
  	      if (a == error_mark_node)
*************** can_complete_type_without_circularity (t
*** 5061,5067 ****
      return 1;
    else if (TREE_CODE (type) == ARRAY_TYPE && TYPE_DOMAIN (type))
      return can_complete_type_without_circularity (TREE_TYPE (type));
!   else if (CLASS_TYPE_P (type) && TYPE_BEING_DEFINED (TYPE_MAIN_VARIANT (type)))
      return 0;
    else
      return 1;
--- 5060,5067 ----
      return 1;
    else if (TREE_CODE (type) == ARRAY_TYPE && TYPE_DOMAIN (type))
      return can_complete_type_without_circularity (TREE_TYPE (type));
!   else if (CLASS_TYPE_P (type)
! 	   && TYPE_BEING_DEFINED (TYPE_MAIN_VARIANT (type)))
      return 0;
    else
      return 1;
*************** instantiate_class_template (tree type)
*** 5100,5107 ****
        for (t = DECL_TEMPLATE_SPECIALIZATIONS (template); t; 
  	   t = TREE_CHAIN (t))
  	{
! 	  if (get_class_bindings (TREE_VALUE (t), TREE_PURPOSE (t),
! 				  args))
  	    {
  	      cp_error_at ("%s %+#T", str, TREE_TYPE (t));
  	      str = "               ";
--- 5100,5106 ----
        for (t = DECL_TEMPLATE_SPECIALIZATIONS (template); t; 
  	   t = TREE_CHAIN (t))
  	{
! 	  if (get_class_bindings (TREE_VALUE (t), TREE_PURPOSE (t), args))
  	    {
  	      cp_error_at ("%s %+#T", str, TREE_TYPE (t));
  	      str = "               ";
*************** instantiate_class_template (tree type)
*** 5255,5261 ****
    pushclass (type, true);
  
    /* Now members are processed in the order of declaration.  */
!   for (member = CLASSTYPE_DECL_LIST (pattern); member; member = TREE_CHAIN (member))
      {
        tree t = TREE_VALUE (member);
  
--- 5254,5261 ----
    pushclass (type, true);
  
    /* Now members are processed in the order of declaration.  */
!   for (member = CLASSTYPE_DECL_LIST (pattern);
!        member; member = TREE_CHAIN (member))
      {
        tree t = TREE_VALUE (member);
  
*************** instantiate_class_template (tree type)
*** 5329,5337 ****
  		      else
  			init = NULL_TREE;
  
! 		      finish_static_data_member_decl (r, init,
! 						      /*asmspec_tree=*/NULL_TREE, 
! 						      /*flags=*/0);
  
  		      if (DECL_INITIALIZED_IN_CLASS_P (r))
  			check_static_variable_definition (r, TREE_TYPE (r));
--- 5329,5336 ----
  		      else
  			init = NULL_TREE;
  
! 		      finish_static_data_member_decl
! 			(r, init, /*asmspec_tree=*/NULL_TREE, /*flags=*/0);
  
  		      if (DECL_INITIALIZED_IN_CLASS_P (r))
  			check_static_variable_definition (r, TREE_TYPE (r));
*************** tsubst_decl (tree t, tree args, tree typ
*** 5853,5866 ****
  	if (PRIMARY_TEMPLATE_P (t))
  	  DECL_PRIMARY_TEMPLATE (r) = r;
  
! 	/* We don't partially instantiate partial specializations.  */
! 	if (TREE_CODE (decl) == TYPE_DECL)
! 	  break;
! 
! 	/* Record this partial instantiation.  */
! 	register_specialization (r, t, 
! 				 DECL_TI_ARGS (DECL_TEMPLATE_RESULT (r)));
! 
        }
        break;
  
--- 5852,5861 ----
  	if (PRIMARY_TEMPLATE_P (t))
  	  DECL_PRIMARY_TEMPLATE (r) = r;
  
! 	if (TREE_CODE (decl) != TYPE_DECL)
! 	  /* Record this non-type partial instantiation.  */
! 	  register_specialization (r, t, 
! 				   DECL_TI_ARGS (DECL_TEMPLATE_RESULT (r)));
        }
        break;
  
*************** tsubst_decl (tree t, tree args, tree typ
*** 5971,5978 ****
  	    else
  	      member = 1;
  	    ctx = tsubst_aggr_type (DECL_CONTEXT (t), args, 
! 				    complain, t, 
! 				    /*entering_scope=*/1);
  	  }
  	else
  	  {
--- 5966,5972 ----
  	    else
  	      member = 1;
  	    ctx = tsubst_aggr_type (DECL_CONTEXT (t), args, 
! 				    complain, t, /*entering_scope=*/1);
  	  }
  	else
  	  {
*************** unify (tree tparms, tree targs, tree par
*** 9474,9481 ****
  	       template <class T, class Allocator = allocator> 
  	       class vector.  */
  
! 	    if (coerce_template_parms (argtmplvec, parmvec, parmtmpl, 0, 1)
! 	        == error_mark_node)
  	      return 1;
  	  
  	    /* Deduce arguments T, i from TT<T> or TT<i>.  
--- 9468,9475 ----
  	       template <class T, class Allocator = allocator> 
  	       class vector.  */
  
! 	    if (coerce_template_parms (argtmplvec, parmvec, parmtmpl,
! 				       tf_none, 1) == error_mark_node)
  	      return 1;
  	  
  	    /* Deduce arguments T, i from TT<T> or TT<i>.  

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