FreeBSD/contrib/gcc/cp/error.c
/* Handle the function name for a FUNCTION_DECL node, grokking operators
   and destructors properly.  */
Handle the function name for a FUNCTION_DECL node, grokking operators
and destructors properly.
Handle the function name for a FUNCTION_DECL node grokking operators and destructors properly .
static void
dump_function_name (tree t, int flags)
{
  tree name = DECL_NAME (t);
  if (!DECL_LANG_SPECIFIC (t))
    {
      pp_cxx_tree_identifier (cxx_pp, name);
      return;
    }
  if (TREE_CODE (t) == TEMPLATE_DECL)
    t = DECL_TEMPLATE_RESULT (t);
  if (DECL_CONSTRUCTOR_P (t)
      || DECL_DESTRUCTOR_P (t))
    name = constructor_name (DECL_CONTEXT (t));
  if (DECL_DESTRUCTOR_P (t))
    {
      pp_cxx_complement (cxx_pp);
      dump_decl (name, TFF_PLAIN_IDENTIFIER);
    }
  else if (DECL_CONV_FN_P (t))
    {
      pp_cxx_identifier (cxx_pp, "operator");
      dump_type (TREE_TYPE (TREE_TYPE (t)), flags);
    }
  else if (IDENTIFIER_OPNAME_P (name))
    pp_cxx_tree_identifier (cxx_pp, name);
  else
    dump_decl (name, flags);
  if (DECL_TEMPLATE_INFO (t)
      && !DECL_FRIEND_PSEUDO_TEMPLATE_INSTANTIATION (t)
      && (TREE_CODE (DECL_TI_TEMPLATE (t)) != TEMPLATE_DECL
	  || PRIMARY_TEMPLATE_P (DECL_TI_TEMPLATE (t))))
    dump_template_parms (DECL_TEMPLATE_INFO (t), !DECL_USE_TEMPLATE (t), flags);
}
static void dump_function_name ( tree t , int flags ) { tree name = DECL_NAME ( t ) ; if ( ! DECL_LANG_SPECIFIC ( t ) ) { pp_cxx_tree_identifier ( cxx_pp , name ) ; return ; } if ( TREE_CODE ( t ) == TEMPLATE_DECL ) t = DECL_TEMPLATE_RESULT ( t ) ; if ( DECL_CONSTRUCTOR_P ( t ) || DECL_DESTRUCTOR_P ( t ) ) name = constructor_name ( DECL_CONTEXT ( t ) ) ; if ( DECL_DESTRUCTOR_P ( t ) ) { pp_cxx_complement ( cxx_pp ) ; dump_decl ( name , TFF_PLAIN_IDENTIFIER ) ; } else if ( DECL_CONV_FN_P ( t ) ) { pp_cxx_identifier ( cxx_pp , " " ) ; dump_type ( TREE_TYPE ( TREE_TYPE ( t ) ) , flags ) ; } else if ( IDENTIFIER_OPNAME_P ( name ) ) pp_cxx_tree_identifier ( cxx_pp , name ) ; else dump_decl ( name , flags ) ; if ( DECL_TEMPLATE_INFO ( t ) && ! DECL_FRIEND_PSEUDO_TEMPLATE_INSTANTIATION ( t ) && ( TREE_CODE ( DECL_TI_TEMPLATE ( t ) ) != TEMPLATE_DECL || PRIMARY_TEMPLATE_P ( DECL_TI_TEMPLATE ( t ) ) ) ) dump_template_parms ( DECL_TEMPLATE_INFO ( t ) , ! DECL_USE_TEMPLATE ( t ) , flags ) ; }
Handle the function name for a FUNCTION_DECL node, grokking operators
and destructors properly.
Handle the function name for a FUNCTION_DECL node grokking operators and destructors properly .
/* We can get here with a decl that was synthesized by language-
     independent machinery (e.g. coverage.c) in which case it won't
     have a lang_specific structure attached and DECL_CONSTRUCTOR_P
     will crash.  In this case it is safe just to print out the
     literal name.  */ /* Don't let the user see __comp_ctor et al.  */ /* This cannot use the hack that the operator's return
	 type is stashed off of its name because it may be
	 used for error reporting.  In the case of conflicting
	 declarations, both will have the same name, yet
	 the types will be different, hence the TREE_TYPE field
	 of the first name will be clobbered by the second.  */