FreeBSD/contrib/gcc/cp/error.c
/* Dump the template parameters from the template info INFO under control of
   FLAGS. PRIMARY indicates whether this is a primary template decl, or
   specialization (partial or complete). For partial specializations we show
   the specialized parameter values. For a primary template we show no
   decoration.  */
Dump the template parameters from the template info INFO under control of
FLAGS. PRIMARY indicates whether this is a primary template decl, or
specialization (partial or complete). For partial specializations we show
the specialized parameter values. For a primary template we show no
decoration.
Dump the template parameters from the template info INFO under control of FLAGS . PRIMARY indicates whether this is a primary template decl or specialization ( partial or complete ) . For partial specializations we show the specialized parameter values . For a primary template we show no decoration .
static void
dump_template_parms (tree info, int primary, int flags)
{
  tree args = info ? TI_ARGS (info) : NULL_TREE;
  if (primary && flags & TFF_TEMPLATE_NAME)
    return;
  flags &= ~(TFF_CLASS_KEY_OR_ENUM | TFF_TEMPLATE_NAME);
  pp_cxx_begin_template_argument_list (cxx_pp);
  if (args && !primary)
    {
      int len, ix;
      if (TMPL_ARGS_HAVE_MULTIPLE_LEVELS (args))
	args = TREE_VEC_ELT (args, TREE_VEC_LENGTH (args) - 1);
      len = TREE_VEC_LENGTH (args);
      for (ix = 0; ix != len; ix++)
	{
	  tree arg = TREE_VEC_ELT (args, ix);
	  if (ix)
	    pp_separate_with_comma (cxx_pp);
	  if (!arg)
	    pp_identifier (cxx_pp, "<template parameter error>");
	  else
	    dump_template_argument (arg, flags);
	}
    }
  else if (primary)
    {
      tree tpl = TI_TEMPLATE (info);
      tree parms = DECL_TEMPLATE_PARMS (tpl);
      int len, ix;
      parms = TREE_CODE (parms) == TREE_LIST ? TREE_VALUE (parms) : NULL_TREE;
      len = parms ? TREE_VEC_LENGTH (parms) : 0;
      for (ix = 0; ix != len; ix++)
	{
	  tree parm;
          if (TREE_VEC_ELT (parms, ix) == error_mark_node)
            {
              pp_identifier (cxx_pp, "<template parameter error>");
              continue;
            }
          parm = TREE_VALUE (TREE_VEC_ELT (parms, ix));
	  if (ix)
	    pp_separate_with_comma (cxx_pp);
	  dump_decl (parm, flags & ~TFF_DECL_SPECIFIERS);
	}
    }
  pp_cxx_end_template_argument_list (cxx_pp);
}
static void dump_template_parms ( tree info , int primary , int flags ) { tree args = info ? TI_ARGS ( info ) : NULL_TREE ; if ( primary && flags & TFF_TEMPLATE_NAME ) return ; flags &= ~ ( TFF_CLASS_KEY_OR_ENUM | TFF_TEMPLATE_NAME ) ; pp_cxx_begin_template_argument_list ( cxx_pp ) ; if ( args && ! primary ) { int len , ix ; if ( TMPL_ARGS_HAVE_MULTIPLE_LEVELS ( args ) ) args = TREE_VEC_ELT ( args , TREE_VEC_LENGTH ( args ) - 1 ) ; len = TREE_VEC_LENGTH ( args ) ; for ( ix = 0 ; ix != len ; ix ++ ) { tree arg = TREE_VEC_ELT ( args , ix ) ; if ( ix ) pp_separate_with_comma ( cxx_pp ) ; if ( ! arg ) pp_identifier ( cxx_pp , " " ) ; else dump_template_argument ( arg , flags ) ; } } else if ( primary ) { tree tpl = TI_TEMPLATE ( info ) ; tree parms = DECL_TEMPLATE_PARMS ( tpl ) ; int len , ix ; parms = TREE_CODE ( parms ) == TREE_LIST ? TREE_VALUE ( parms ) : NULL_TREE ; len = parms ? TREE_VEC_LENGTH ( parms ) : 0 ; for ( ix = 0 ; ix != len ; ix ++ ) { tree parm ; if ( TREE_VEC_ELT ( parms , ix ) == error_mark_node ) { pp_identifier ( cxx_pp , " " ) ; continue ; } parm = TREE_VALUE ( TREE_VEC_ELT ( parms , ix ) ) ; if ( ix ) pp_separate_with_comma ( cxx_pp ) ; dump_decl ( parm , flags & ~ TFF_DECL_SPECIFIERS ) ; } } pp_cxx_end_template_argument_list ( cxx_pp ) ; }
Dump the template parameters from the template info INFO under control of
FLAGS.
Dump the template parameters from the template info INFO under control of FLAGS .
/* Be careful only to print things when we have them, so as not
	 to crash producing error messages.  */