FreeBSD/contrib/gcc/cp/error.c
/* Dump a template parameter PARM (a TREE_LIST) under control of FLAGS.  */
Dump a template parameter PARM (a TREE_LIST) under control of FLAGS.
Dump a template parameter PARM ( a TREE_LIST ) under control of FLAGS .
static void
dump_template_parameter (tree parm, int flags)
{
  tree p;
  tree a;
  if (parm == error_mark_node)
   return;
  p = TREE_VALUE (parm);
  a = TREE_PURPOSE (parm);
  if (TREE_CODE (p) == TYPE_DECL)
    {
      if (flags & TFF_DECL_SPECIFIERS)
	{
	  pp_cxx_identifier (cxx_pp, "class");
	  if (DECL_NAME (p))
	    pp_cxx_tree_identifier (cxx_pp, DECL_NAME (p));
	}
      else if (DECL_NAME (p))
	pp_cxx_tree_identifier (cxx_pp, DECL_NAME (p));
      else
	pp_cxx_canonical_template_parameter (cxx_pp, TREE_TYPE (p));
    }
  else
    dump_decl (p, flags | TFF_DECL_SPECIFIERS);
  if ((flags & TFF_FUNCTION_DEFAULT_ARGUMENTS) && a != NULL_TREE)
    {
      pp_cxx_whitespace (cxx_pp);
      pp_equal (cxx_pp);
      pp_cxx_whitespace (cxx_pp);
      if (TREE_CODE (p) == TYPE_DECL || TREE_CODE (p) == TEMPLATE_DECL)
	dump_type (a, flags & ~TFF_CHASE_TYPEDEF);
      else
	dump_expr (a, flags | TFF_EXPR_IN_PARENS);
    }
}
static void dump_template_parameter ( tree parm , int flags ) { tree p ; tree a ; if ( parm == error_mark_node ) return ; p = TREE_VALUE ( parm ) ; a = TREE_PURPOSE ( parm ) ; if ( TREE_CODE ( p ) == TYPE_DECL ) { if ( flags & TFF_DECL_SPECIFIERS ) { pp_cxx_identifier ( cxx_pp , " " ) ; if ( DECL_NAME ( p ) ) pp_cxx_tree_identifier ( cxx_pp , DECL_NAME ( p ) ) ; } else if ( DECL_NAME ( p ) ) pp_cxx_tree_identifier ( cxx_pp , DECL_NAME ( p ) ) ; else pp_cxx_canonical_template_parameter ( cxx_pp , TREE_TYPE ( p ) ) ; } else dump_decl ( p , flags | TFF_DECL_SPECIFIERS ) ; if ( ( flags & TFF_FUNCTION_DEFAULT_ARGUMENTS ) && a != NULL_TREE ) { pp_cxx_whitespace ( cxx_pp ) ; pp_equal ( cxx_pp ) ; pp_cxx_whitespace ( cxx_pp ) ; if ( TREE_CODE ( p ) == TYPE_DECL || TREE_CODE ( p ) == TEMPLATE_DECL ) dump_type ( a , flags & ~ TFF_CHASE_TYPEDEF ) ; else dump_expr ( a , flags | TFF_EXPR_IN_PARENS ) ; } }
Dump a template parameter PARM (a TREE_LIST) under control of FLAGS.
Dump a template parameter PARM ( a TREE_LIST ) under control of FLAGS .