FreeBSD/contrib/gcc/cp/class.c
/* Convert OBJECT to the base TYPE.  OBJECT is an expression whose
   type is a class type or a pointer to a class type.  In the former
   case, TYPE is also a class type; in the latter it is another
   pointer type.  If CHECK_ACCESS is true, an error message is emitted
   if TYPE is inaccessible.  If OBJECT has pointer type, the value is
   assumed to be non-NULL.  */
Convert OBJECT to the base TYPE.  OBJECT is an expression whose
type is a class type or a pointer to a class type.  In the former
case, TYPE is also a class type; in the latter it is another
pointer type.  If CHECK_ACCESS is true, an error message is emitted
if TYPE is inaccessible.  If OBJECT has pointer type, the value is
assumed to be non-NULL.
Convert OBJECT to the base TYPE . OBJECT is an expression whose type is a class type or a pointer to a class type . In the former case TYPE is also a class type ; in the latter it is another pointer type . If CHECK_ACCESS is true an error message is emitted if TYPE is inaccessible . If OBJECT has pointer type the value is assumed to be non - NULL .
tree
convert_to_base (tree object, tree type, bool check_access, bool nonnull)
{
  tree binfo;
  tree object_type;
  if (TYPE_PTR_P (TREE_TYPE (object)))
    {
      object_type = TREE_TYPE (TREE_TYPE (object));
      type = TREE_TYPE (type);
    }
  else
    object_type = TREE_TYPE (object);
  binfo = lookup_base (object_type, type,
		       check_access ? ba_check : ba_unique,
		       NULL);
  if (!binfo || binfo == error_mark_node)
    return error_mark_node;
  return build_base_path (PLUS_EXPR, object, binfo, nonnull);
}
tree convert_to_base ( tree object , tree type , bool check_access , bool nonnull ) { tree binfo ; tree object_type ; if ( TYPE_PTR_P ( TREE_TYPE ( object ) ) ) { object_type = TREE_TYPE ( TREE_TYPE ( object ) ) ; type = TREE_TYPE ( type ) ; } else object_type = TREE_TYPE ( object ) ; binfo = lookup_base ( object_type , type , check_access ? ba_check : ba_unique , NULL ) ; if ( ! binfo || binfo == error_mark_node ) return error_mark_node ; return build_base_path ( PLUS_EXPR , object , binfo , nonnull ) ; }
Convert OBJECT to the base TYPE.
Convert OBJECT to the base TYPE .