FreeBSD/contrib/gcc/cp/typeck.c
/* Subroutine of composite_pointer_type to implement the recursive
   case.  See that function for documentation fo the parameters.  */
Subroutine of composite_pointer_type to implement the recursive
case.  See that function for documentation fo the parameters.
Subroutine of composite_pointer_type to implement the recursive case . See that function for documentation fo the parameters .
static tree
composite_pointer_type_r (tree t1, tree t2, const char* location)
{
  tree pointee1;
  tree pointee2;
  tree result_type;
  tree attributes;
  if (TREE_CODE (t1) == POINTER_TYPE || TREE_CODE (t1) == BLOCK_POINTER_TYPE)
    {
      pointee1 = TREE_TYPE (t1);
      pointee2 = TREE_TYPE (t2);
    }
  else
    {
      pointee1 = TYPE_PTRMEM_POINTED_TO_TYPE (t1);
      pointee2 = TYPE_PTRMEM_POINTED_TO_TYPE (t2);
    }
  if (same_type_ignoring_top_level_qualifiers_p (pointee1, pointee2))
    result_type = pointee1;
  else if ((TREE_CODE (pointee1) == POINTER_TYPE
	    && TREE_CODE (pointee2) == POINTER_TYPE)
	   || (TYPE_PTR_TO_MEMBER_P (pointee1)
	       && TYPE_PTR_TO_MEMBER_P (pointee2)))
    result_type = composite_pointer_type_r (pointee1, pointee2, location);
  else
    {
      pedwarn ("%s between distinct pointer types %qT and %qT "
	       "lacks a cast",
	       location, t1, t2);
      result_type = void_type_node;
    }
  result_type = cp_build_qualified_type (result_type,
					 (cp_type_quals (pointee1)
					  | cp_type_quals (pointee2)));
  if (TYPE_PTR_TO_MEMBER_P (t1))
    {
      if (!same_type_p (TYPE_PTRMEM_CLASS_TYPE (t1),
			TYPE_PTRMEM_CLASS_TYPE (t2)))
	pedwarn ("%s between distinct pointer types %qT and %qT "
		 "lacks a cast",
		 location, t1, t2);
      result_type = build_ptrmem_type (TYPE_PTRMEM_CLASS_TYPE (t1),
				       result_type);
    }
  else if (TREE_CODE (t1) == BLOCK_POINTER_TYPE
     && result_type != void_type_node)
    result_type = build_block_pointer_type (result_type);
  else
    result_type = build_pointer_type (result_type);
  attributes = (*targetm.merge_type_attributes) (t1, t2);
  return build_type_attribute_variant (result_type, attributes);
}
static tree composite_pointer_type_r ( tree t1 , tree t2 , const char * location ) { tree pointee1 ; tree pointee2 ; tree result_type ; tree attributes ; if ( TREE_CODE ( t1 ) == POINTER_TYPE || TREE_CODE ( t1 ) == BLOCK_POINTER_TYPE ) { pointee1 = TREE_TYPE ( t1 ) ; pointee2 = TREE_TYPE ( t2 ) ; } else { pointee1 = TYPE_PTRMEM_POINTED_TO_TYPE ( t1 ) ; pointee2 = TYPE_PTRMEM_POINTED_TO_TYPE ( t2 ) ; } if ( same_type_ignoring_top_level_qualifiers_p ( pointee1 , pointee2 ) ) result_type = pointee1 ; else if ( ( TREE_CODE ( pointee1 ) == POINTER_TYPE && TREE_CODE ( pointee2 ) == POINTER_TYPE ) || ( TYPE_PTR_TO_MEMBER_P ( pointee1 ) && TYPE_PTR_TO_MEMBER_P ( pointee2 ) ) ) result_type = composite_pointer_type_r ( pointee1 , pointee2 , location ) ; else { pedwarn ( " " " " , location , t1 , t2 ) ; result_type = void_type_node ; } result_type = cp_build_qualified_type ( result_type , ( cp_type_quals ( pointee1 ) | cp_type_quals ( pointee2 ) ) ) ; if ( TYPE_PTR_TO_MEMBER_P ( t1 ) ) { if ( ! same_type_p ( TYPE_PTRMEM_CLASS_TYPE ( t1 ) , TYPE_PTRMEM_CLASS_TYPE ( t2 ) ) ) pedwarn ( " " " " , location , t1 , t2 ) ; result_type = build_ptrmem_type ( TYPE_PTRMEM_CLASS_TYPE ( t1 ) , result_type ) ; } else if ( TREE_CODE ( t1 ) == BLOCK_POINTER_TYPE && result_type != void_type_node ) result_type = build_block_pointer_type ( result_type ) ; else result_type = build_pointer_type ( result_type ) ; attributes = ( * targetm . merge_type_attributes ) ( t1 , t2 ) ; return build_type_attribute_variant ( result_type , attributes ) ; }
Subroutine of composite_pointer_type to implement the recursive
case.
Subroutine of composite_pointer_type to implement the recursive case .
/* Determine the types pointed to by T1 and T2.  */ /* APPLE LOCAL blocks 6040305 */ /* [expr.rel]

     Otherwise, the composite pointer type is a pointer type
     similar (_conv.qual_) to the type of one of the operands,
     with a cv-qualification signature (_conv.qual_) that is the
     union of the cv-qualification signatures of the operand
     types.  */ /* If the original types were pointers to members, so is the
     result.  */ /* APPLE LOCAL begin blocks 6065211 */ /* APPLE LOCAL end blocks 6065211 */ /* Merge the attributes.  */