FreeBSD/contrib/gcc/cp/method.c
/* Locate the copy ctor or copy assignment of TYPE. CLIENT_
   points to a COPY_DATA holding the name (NULL for the ctor)
   and desired qualifiers of the source operand.  */
Locate the copy ctor or copy assignment of TYPE. CLIENT_
points to a COPY_DATA holding the name (NULL for the ctor)
and desired qualifiers of the source operand.
Locate the copy ctor or copy assignment of TYPE . CLIENT_ points to a COPY_DATA holding the name ( NULL for the ctor ) and desired qualifiers of the source operand .
static tree
locate_copy (tree type, void *client_)
{
  struct copy_data *client = (struct copy_data *)client_;
  tree fns;
  tree best = NULL_TREE;
  bool excess_p = false;
  if (client->name)
    {
      int ix;
      ix = lookup_fnfields_1 (type, client->name);
      if (ix < 0)
	return NULL_TREE;
      fns = VEC_index (tree, CLASSTYPE_METHOD_VEC (type), ix);
    }
  else if (TYPE_HAS_INIT_REF (type))
    {
      if (CLASSTYPE_LAZY_COPY_CTOR (type))
	lazily_declare_fn (sfk_copy_constructor, type);
      fns = CLASSTYPE_CONSTRUCTORS (type);
    }
  else
    return NULL_TREE;
  for (; fns; fns = OVL_NEXT (fns))
    {
      tree fn = OVL_CURRENT (fns);
      tree parms = TYPE_ARG_TYPES (TREE_TYPE (fn));
      tree src_type;
      int excess;
      int quals;
      parms = skip_artificial_parms_for (fn, parms);
      if (!parms)
	continue;
      src_type = non_reference (TREE_VALUE (parms));
      if (src_type == error_mark_node)
        return NULL_TREE;
      if (!same_type_ignoring_top_level_qualifiers_p (src_type, type))
	continue;
      if (!sufficient_parms_p (TREE_CHAIN (parms)))
	continue;
      quals = cp_type_quals (src_type);
      if (client->quals & ~quals)
	continue;
      excess = quals & ~client->quals;
      if (!best || (excess_p && !excess))
	{
	  best = fn;
	  excess_p = excess;
	}
      else
	return NULL_TREE;
    }
  return best;
}
static tree locate_copy ( tree type , void * client_ ) { struct copy_data * client = ( struct copy_data * ) client_ ; tree fns ; tree best = NULL_TREE ; bool excess_p = false ; if ( client -> name ) { int ix ; ix = lookup_fnfields_1 ( type , client -> name ) ; if ( ix < 0 ) return NULL_TREE ; fns = VEC_index ( tree , CLASSTYPE_METHOD_VEC ( type ) , ix ) ; } else if ( TYPE_HAS_INIT_REF ( type ) ) { if ( CLASSTYPE_LAZY_COPY_CTOR ( type ) ) lazily_declare_fn ( sfk_copy_constructor , type ) ; fns = CLASSTYPE_CONSTRUCTORS ( type ) ; } else return NULL_TREE ; for ( ; fns ; fns = OVL_NEXT ( fns ) ) { tree fn = OVL_CURRENT ( fns ) ; tree parms = TYPE_ARG_TYPES ( TREE_TYPE ( fn ) ) ; tree src_type ; int excess ; int quals ; parms = skip_artificial_parms_for ( fn , parms ) ; if ( ! parms ) continue ; src_type = non_reference ( TREE_VALUE ( parms ) ) ; if ( src_type == error_mark_node ) return NULL_TREE ; if ( ! same_type_ignoring_top_level_qualifiers_p ( src_type , type ) ) continue ; if ( ! sufficient_parms_p ( TREE_CHAIN ( parms ) ) ) continue ; quals = cp_type_quals ( src_type ) ; if ( client -> quals & ~ quals ) continue ; excess = quals & ~ client -> quals ; if ( ! best || ( excess_p && ! excess ) ) { best = fn ; excess_p = excess ; } else return NULL_TREE ; } return best ; }
Locate the copy ctor or copy assignment of TYPE.
Locate the copy ctor or copy assignment of TYPE .
/* If construction of the copy constructor was postponed, create
	 it now.  */ /* Ambiguous */