FreeBSD/contrib/gcc/cp/cvt.c
/* Like convert, except permit conversions to take place which
   are not normally allowed due to access restrictions
   (such as conversion from sub-type to private super-type).  */
Like convert, except permit conversions to take place which
are not normally allowed due to access restrictions
(such as conversion from sub-type to private super-type).
Like convert except permit conversions to take place which are not normally allowed due to access restrictions ( such as conversion from sub - type to private super - type ) .
static tree
convert_to_pointer_force (tree type, tree expr)
{
  tree intype = TREE_TYPE (expr);
  enum tree_code form = TREE_CODE (intype);
  if (form == POINTER_TYPE)
    {
      intype = TYPE_MAIN_VARIANT (intype);
      if (TYPE_MAIN_VARIANT (type) != intype
	  && TREE_CODE (TREE_TYPE (type)) == RECORD_TYPE
	  && IS_AGGR_TYPE (TREE_TYPE (type))
	  && IS_AGGR_TYPE (TREE_TYPE (intype))
	  && TREE_CODE (TREE_TYPE (intype)) == RECORD_TYPE)
	{
	  enum tree_code code = PLUS_EXPR;
	  tree binfo;
	  binfo = lookup_base (TREE_TYPE (intype), TREE_TYPE (type),
			       ba_unique, NULL);
	  if (!binfo)
	    {
	      binfo = lookup_base (TREE_TYPE (type), TREE_TYPE (intype),
				   ba_unique, NULL);
	      code = MINUS_EXPR;
	    }
	  if (binfo == error_mark_node)
	    return error_mark_node;
	  if (binfo)
	    {
	      expr = build_base_path (code, expr, binfo, 0);
	      if (expr == error_mark_node)
		 return error_mark_node;
	      if (!same_type_p (TREE_TYPE (TREE_TYPE (expr)),
				TREE_TYPE (type)))
		expr = build_nop (type, expr);
	      return expr;
	    }
	}
    }
  return cp_convert_to_pointer (type, expr, true);
}
static tree convert_to_pointer_force ( tree type , tree expr ) { tree intype = TREE_TYPE ( expr ) ; enum tree_code form = TREE_CODE ( intype ) ; if ( form == POINTER_TYPE ) { intype = TYPE_MAIN_VARIANT ( intype ) ; if ( TYPE_MAIN_VARIANT ( type ) != intype && TREE_CODE ( TREE_TYPE ( type ) ) == RECORD_TYPE && IS_AGGR_TYPE ( TREE_TYPE ( type ) ) && IS_AGGR_TYPE ( TREE_TYPE ( intype ) ) && TREE_CODE ( TREE_TYPE ( intype ) ) == RECORD_TYPE ) { enum tree_code code = PLUS_EXPR ; tree binfo ; binfo = lookup_base ( TREE_TYPE ( intype ) , TREE_TYPE ( type ) , ba_unique , NULL ) ; if ( ! binfo ) { binfo = lookup_base ( TREE_TYPE ( type ) , TREE_TYPE ( intype ) , ba_unique , NULL ) ; code = MINUS_EXPR ; } if ( binfo == error_mark_node ) return error_mark_node ; if ( binfo ) { expr = build_base_path ( code , expr , binfo , 0 ) ; if ( expr == error_mark_node ) return error_mark_node ; if ( ! same_type_p ( TREE_TYPE ( TREE_TYPE ( expr ) ) , TREE_TYPE ( type ) ) ) expr = build_nop ( type , expr ) ; return expr ; } } } return cp_convert_to_pointer ( type , expr , true ) ; }
Like convert, except permit conversions to take place which
are not normally allowed due to access restrictions
(such as conversion from sub-type to private super-type).
Like convert except permit conversions to take place which are not normally allowed due to access restrictions ( such as conversion from sub - type to private super - type ) .
/* Add any qualifier conversions.  */