FreeBSD/contrib/gcc/cp/typeck.c
/* EXPR is an expression with member function or pointer-to-member
   function type.  TYPE is a pointer type.  Converting EXPR to TYPE is
   not permitted by ISO C++, but we accept it in some modes.  If we
   are not in one of those modes, issue a diagnostic.  Return the
   converted expression.  */
EXPR is an expression with member function or pointer-to-member
function type.  TYPE is a pointer type.  Converting EXPR to TYPE is
not permitted by ISO C++, but we accept it in some modes.  If we
are not in one of those modes, issue a diagnostic.  Return the
converted expression.
EXPR is an expression with member function or pointer - to - member function type . TYPE is a pointer type . Converting EXPR to TYPE is not permitted by ISO C ++ but we accept it in some modes . If we are not in one of those modes issue a diagnostic . Return the converted expression .
tree
convert_member_func_to_ptr (tree type, tree expr)
{
  tree intype;
  tree decl;
  intype = TREE_TYPE (expr);
  gcc_assert (TYPE_PTRMEMFUNC_P (intype)
	      || TREE_CODE (intype) == METHOD_TYPE);
  if (pedantic || warn_pmf2ptr)
    pedwarn ("converting from %qT to %qT", intype, type);
  if (TREE_CODE (intype) == METHOD_TYPE)
    expr = build_addr_func (expr);
  else if (TREE_CODE (expr) == PTRMEM_CST)
    expr = build_address (PTRMEM_CST_MEMBER (expr));
  else
    {
      decl = maybe_dummy_object (TYPE_PTRMEM_CLASS_TYPE (intype), 0);
      decl = build_address (decl);
      expr = get_member_function_from_ptrfunc (&decl, expr);
    }
  return build_nop (type, expr);
}
tree convert_member_func_to_ptr ( tree type , tree expr ) { tree intype ; tree decl ; intype = TREE_TYPE ( expr ) ; gcc_assert ( TYPE_PTRMEMFUNC_P ( intype ) || TREE_CODE ( intype ) == METHOD_TYPE ) ; if ( pedantic || warn_pmf2ptr ) pedwarn ( " " , intype , type ) ; if ( TREE_CODE ( intype ) == METHOD_TYPE ) expr = build_addr_func ( expr ) ; else if ( TREE_CODE ( expr ) == PTRMEM_CST ) expr = build_address ( PTRMEM_CST_MEMBER ( expr ) ) ; else { decl = maybe_dummy_object ( TYPE_PTRMEM_CLASS_TYPE ( intype ) , 0 ) ; decl = build_address ( decl ) ; expr = get_member_function_from_ptrfunc ( & decl , expr ) ; } return build_nop ( type , expr ) ; }
EXPR is an expression with member function or pointer-to-member
function type.
EXPR is an expression with member function or pointer - to - member function type .