FreeBSD/contrib/gcc/cp/typeck.c
/* Returns 1 if to and from are (possibly multi-level) pointers to the same
   type or inheritance-related types, regardless of cv-quals.  */
Returns 1 if to and from are (possibly multi-level) pointers to the same
type or inheritance-related types, regardless of cv-quals.
Returns 1 if to and from are ( possibly multi - level ) pointers to the same type or inheritance - related types regardless of cv - quals .
int
ptr_reasonably_similar (tree to, tree from)
{
  for (; ; to = TREE_TYPE (to), from = TREE_TYPE (from))
    {
      if (TREE_CODE (to) == VOID_TYPE
	  || TREE_CODE (from) == VOID_TYPE)
	return 1;
      if (TREE_CODE (to) != TREE_CODE (from))
	return 0;
      if (TREE_CODE (from) == OFFSET_TYPE
	  && comptypes (TYPE_OFFSET_BASETYPE (to),
			TYPE_OFFSET_BASETYPE (from),
			COMPARE_BASE | COMPARE_DERIVED))
	continue;
      if (TREE_CODE (to) == VECTOR_TYPE
	  && vector_types_convertible_p (to, from, false))
	return 1;
      if (TREE_CODE (to) == INTEGER_TYPE
	  && TYPE_PRECISION (to) == TYPE_PRECISION (from))
	return 1;
      if (TREE_CODE (to) == FUNCTION_TYPE)
	return 1;
      if (TREE_CODE (to) != POINTER_TYPE)
	return comptypes
	  (TYPE_MAIN_VARIANT (to), TYPE_MAIN_VARIANT (from),
	   COMPARE_BASE | COMPARE_DERIVED);
    }
}
int ptr_reasonably_similar ( tree to , tree from ) { for ( ; ; to = TREE_TYPE ( to ) , from = TREE_TYPE ( from ) ) { if ( TREE_CODE ( to ) == VOID_TYPE || TREE_CODE ( from ) == VOID_TYPE ) return 1 ; if ( TREE_CODE ( to ) != TREE_CODE ( from ) ) return 0 ; if ( TREE_CODE ( from ) == OFFSET_TYPE && comptypes ( TYPE_OFFSET_BASETYPE ( to ) , TYPE_OFFSET_BASETYPE ( from ) , COMPARE_BASE | COMPARE_DERIVED ) ) continue ; if ( TREE_CODE ( to ) == VECTOR_TYPE && vector_types_convertible_p ( to , from , false ) ) return 1 ; if ( TREE_CODE ( to ) == INTEGER_TYPE && TYPE_PRECISION ( to ) == TYPE_PRECISION ( from ) ) return 1 ; if ( TREE_CODE ( to ) == FUNCTION_TYPE ) return 1 ; if ( TREE_CODE ( to ) != POINTER_TYPE ) return comptypes ( TYPE_MAIN_VARIANT ( to ) , TYPE_MAIN_VARIANT ( from ) , COMPARE_BASE | COMPARE_DERIVED ) ; } }
Returns 1 if to and from are (possibly multi-level) pointers to the same
type or inheritance-related types, regardless of cv-quals.
Returns 1 if to and from are ( possibly multi - level ) pointers to the same type or inheritance - related types regardless of cv - quals .
/* Any target type is similar enough to void.  */