FreeBSD/contrib/gcc/cp/typeck.c
/* Returns nonzero if the pointer-type FROM can be converted to the
   pointer-type TO via a qualification conversion.  If CONSTP is -1,
   then we return nonzero if the pointers are similar, and the
   cv-qualification signature of FROM is a proper subset of that of TO.

   If CONSTP is positive, then all outer pointers have been
   const-qualified.  */
Returns nonzero if the pointer-type FROM can be converted to the
pointer-type TO via a qualification conversion.  If CONSTP is -1,
then we return nonzero if the pointers are similar, and the
cv-qualification signature of FROM is a proper subset of that of TO.

If CONSTP is positive, then all outer pointers have been
const-qualified.
Returns nonzero if the pointer - type FROM can be converted to the pointer - type TO via a qualification conversion . If CONSTP is - 1 then we return nonzero if the pointers are similar and the cv - qualification signature of FROM is a proper subset of that of TO . If CONSTP is positive then all outer pointers have been const - qualified .
static int
comp_ptr_ttypes_real (tree to, tree from, int constp)
{
  bool to_more_cv_qualified = false;
  for (; ; to = TREE_TYPE (to), from = TREE_TYPE (from))
    {
      if (TREE_CODE (to) != TREE_CODE (from))
	return 0;
      if (TREE_CODE (from) == OFFSET_TYPE
	  && !same_type_p (TYPE_OFFSET_BASETYPE (from),
			   TYPE_OFFSET_BASETYPE (to)))
	return 0;
      if (TREE_CODE (to) != FUNCTION_TYPE && TREE_CODE (to) != METHOD_TYPE)
	{
	  bool objc_quals_match = objc_type_quals_match (to, from);
	  if (!at_least_as_qualified_p (to, from) && !objc_quals_match)
	    return 0;
	  if (!at_least_as_qualified_p (from, to) && !objc_quals_match)
	    {
	      if (constp == 0)
		return 0;
	      to_more_cv_qualified = true;
	    }
	  if (constp > 0)
	    constp &= TYPE_READONLY (to);
	}
      if (TREE_CODE (to) != POINTER_TYPE && !TYPE_PTRMEM_P (to))
	return ((constp >= 0 || to_more_cv_qualified)
		&& same_type_ignoring_top_level_qualifiers_p (to, from));
    }
}
static int comp_ptr_ttypes_real ( tree to , tree from , int constp ) { bool to_more_cv_qualified = false ; for ( ; ; to = TREE_TYPE ( to ) , from = TREE_TYPE ( from ) ) { if ( TREE_CODE ( to ) != TREE_CODE ( from ) ) return 0 ; if ( TREE_CODE ( from ) == OFFSET_TYPE && ! same_type_p ( TYPE_OFFSET_BASETYPE ( from ) , TYPE_OFFSET_BASETYPE ( to ) ) ) return 0 ; if ( TREE_CODE ( to ) != FUNCTION_TYPE && TREE_CODE ( to ) != METHOD_TYPE ) { bool objc_quals_match = objc_type_quals_match ( to , from ) ; if ( ! at_least_as_qualified_p ( to , from ) && ! objc_quals_match ) return 0 ; if ( ! at_least_as_qualified_p ( from , to ) && ! objc_quals_match ) { if ( constp == 0 ) return 0 ; to_more_cv_qualified = true ; } if ( constp > 0 ) constp &= TYPE_READONLY ( to ) ; } if ( TREE_CODE ( to ) != POINTER_TYPE && ! TYPE_PTRMEM_P ( to ) ) return ( ( constp >= 0 || to_more_cv_qualified ) && same_type_ignoring_top_level_qualifiers_p ( to , from ) ) ; } }
Returns nonzero if the pointer-type FROM can be converted to the
pointer-type TO via a qualification conversion.
Returns nonzero if the pointer - type FROM can be converted to the pointer - type TO via a qualification conversion .
/* Const and volatile mean something different for function types,
	 so the usual checks are not appropriate.  */ /* In Objective-C++, some types may have been 'volatilized' by
	     the compiler for EH; when comparing them here, the volatile
	     qualification must be ignored.  */