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 33118


Hi,

this is a purely diagnostic issue, but I'm also taking the occasion to
clean up a bit. I would be nice if Doug could double check.

Tested x86_64-linux. NB: I'm not adding a testcase because the dump_expr
problem happens outside the "error:" string: I don't know how to check
with DejaGNU the other informative outputs. Help more than welcome of
course!

Ok for mainline?

Thanks,
Paolo.

////////////////////
2007-09-24  Paolo Carlini  <pcarlini@suse.de>

	PR c++/33118
	* error.c (dump_expr): Deal with ARGUMENT_PACK_SELECT.
	(dump_type): Use dump_template_argument for TYPE_ARGUMENT_PACK.
	(dump_parameters): Just call dump_type for argument packs too.
Index: error.c
===================================================================
*** error.c	(revision 128682)
--- error.c	(working copy)
*************** dump_type (tree t, int flags)
*** 396,411 ****
        break;
  
      case TYPE_ARGUMENT_PACK:
!       {
!         tree args = ARGUMENT_PACK_ARGS (t);
!         int i;
!         for (i = 0; i < TREE_VEC_LENGTH (args); ++i)
!           {
!             if (i)
!               pp_separate_with_comma (cxx_pp);
!             dump_type (TREE_VEC_ELT (args, i), flags);
!           }
!       }
        break;
  
      case DECLTYPE_TYPE:
--- 396,402 ----
        break;
  
      case TYPE_ARGUMENT_PACK:
!       dump_template_argument (t, flags);
        break;
  
      case DECLTYPE_TYPE:
*************** dump_parameters (tree parmtypes, int fla
*** 1168,1189 ****
  	  pp_cxx_identifier (cxx_pp, "...");
  	  break;
  	}
!       if (ARGUMENT_PACK_P (TREE_VALUE (parmtypes)))
!         {
!           tree types = ARGUMENT_PACK_ARGS (TREE_VALUE (parmtypes));
!           int i, len = TREE_VEC_LENGTH (types);
! 	  first = 1;
!           for (i = 0; i < len; ++i)
!             {
!               if (!first)
!                 pp_separate_with_comma (cxx_pp);
!               first = 0;
!               
!               dump_type (TREE_VEC_ELT (types, i), flags);
!             }
!         }
!       else
!         dump_type (TREE_VALUE (parmtypes), flags);
  
        if ((flags & TFF_FUNCTION_DEFAULT_ARGUMENTS) && TREE_PURPOSE (parmtypes))
  	{
--- 1159,1166 ----
  	  pp_cxx_identifier (cxx_pp, "...");
  	  break;
  	}
! 
!       dump_type (TREE_VALUE (parmtypes), flags);
  
        if ((flags & TFF_FUNCTION_DEFAULT_ARGUMENTS) && TREE_PURPOSE (parmtypes))
  	{
*************** dump_expr (tree t, int flags)
*** 2031,2036 ****
--- 2008,2017 ----
        pp_cxx_identifier (cxx_pp, "...");
        break;
  
+     case ARGUMENT_PACK_SELECT:
+       dump_template_argument (ARGUMENT_PACK_SELECT_FROM_PACK (t), flags);
+       break;
+ 
      case RECORD_TYPE:
      case UNION_TYPE:
      case ENUMERAL_TYPE:

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