static tree
resolve_address_of_overloaded_function (tree target_type,
tree overload,
- tsubst_flags_t flags,
+ tsubst_flags_t complain,
bool template_only,
tree explicit_targs,
tree access_path)
target_type = build_reference_type (target_type);
else
{
- if (flags & tf_error)
+ if (complain & tf_error)
error ("cannot resolve overloaded function %qD based on"
" conversion to type %qT",
DECL_NAME (OVL_FUNCTION (overload)), target_type);
if (matches == NULL_TREE)
{
/* There were *no* matches. */
- if (flags & tf_error)
+ if (complain & tf_error)
{
error ("no matches converting function %qD to type %q#T",
DECL_NAME (OVL_CURRENT (overload)),
if (match)
{
- if (flags & tf_error)
+ if (complain & tf_error)
{
error ("converting overloaded function %qD to type %q#T is ambiguous",
DECL_NAME (OVL_FUNCTION (overload)),
fn = TREE_PURPOSE (matches);
if (DECL_NONSTATIC_MEMBER_FUNCTION_P (fn)
- && !(flags & tf_ptrmem_ok) && !flag_ms_extensions)
+ && !(complain & tf_ptrmem_ok) && !flag_ms_extensions)
{
static int explained;
- if (!(flags & tf_error))
+ if (!(complain & tf_error))
return error_mark_node;
permerror (input_location, "assuming pointer to member %qD", fn);
if (fn == NULL)
return error_mark_node;
/* Mark all the versions corresponding to the dispatcher as used. */
- if (!(flags & tf_conv))
+ if (!(complain & tf_conv))
mark_versions_used (fn);
}
determining conversion sequences, we should not consider the
function used. If this conversion sequence is selected, the
function will be marked as used at this point. */
- if (!(flags & tf_conv))
+ if (!(complain & tf_conv))
{
/* Make =delete work with SFINAE. */
- if (DECL_DELETED_FN (fn) && !(flags & tf_error))
+ if (DECL_DELETED_FN (fn) && !(complain & tf_error))
return error_mark_node;
- if (!mark_used (fn, flags) && !(flags & tf_error))
+ if (!mark_used (fn, complain) && !(complain & tf_error))
return error_mark_node;
}
if (DECL_FUNCTION_MEMBER_P (fn))
{
gcc_assert (access_path);
- perform_or_defer_access_check (access_path, fn, fn, flags);
+ perform_or_defer_access_check (access_path, fn, fn, complain);
}
if (TYPE_PTRFN_P (target_type) || TYPE_PTRMEMFUNC_P (target_type))
- return cp_build_addr_expr (fn, flags);
+ return cp_build_addr_expr (fn, complain);
else
{
/* The target must be a REFERENCE_TYPE. Above, cp_build_unary_op
/* This function will instantiate the type of the expression given in
RHS to match the type of LHSTYPE. If errors exist, then return
- error_mark_node. FLAGS is a bit mask. If TF_ERROR is set, then
+ error_mark_node. COMPLAIN is a bit mask. If TF_ERROR is set, then
we complain on errors. If we are not complaining, never modify rhs,
as overload resolution wants to try many possible instantiations, in
the hope that at least one will work.
function, or a pointer to member function. */
tree
-instantiate_type (tree lhstype, tree rhs, tsubst_flags_t flags)
+instantiate_type (tree lhstype, tree rhs, tsubst_flags_t complain)
{
- tsubst_flags_t flags_in = flags;
+ tsubst_flags_t complain_in = complain;
tree access_path = NULL_TREE;
- flags &= ~tf_ptrmem_ok;
+ complain &= ~tf_ptrmem_ok;
if (lhstype == unknown_type_node)
{
- if (flags & tf_error)
+ if (complain & tf_error)
error ("not enough type information");
return error_mark_node;
}
;
else
{
- if (flags & tf_error)
+ if (complain & tf_error)
error ("cannot convert %qE from type %qT to type %qT",
rhs, TREE_TYPE (rhs), fntype);
return error_mark_node;
deduce any type information. */
if (TREE_CODE (rhs) == NON_DEPENDENT_EXPR)
{
- if (flags & tf_error)
+ if (complain & tf_error)
error ("not enough type information");
return error_mark_node;
}
{
tree member = TREE_OPERAND (rhs, 1);
- member = instantiate_type (lhstype, member, flags);
+ member = instantiate_type (lhstype, member, complain);
if (member != error_mark_node
&& TREE_SIDE_EFFECTS (TREE_OPERAND (rhs, 0)))
/* Do not lose object's side effects. */
case OFFSET_REF:
rhs = TREE_OPERAND (rhs, 1);
if (BASELINK_P (rhs))
- return instantiate_type (lhstype, rhs, flags_in);
+ return instantiate_type (lhstype, rhs, complain_in);
/* This can happen if we are forming a pointer-to-member for a
member template. */
tree args = TREE_OPERAND (rhs, 1);
return
- resolve_address_of_overloaded_function (lhstype, fns, flags_in,
+ resolve_address_of_overloaded_function (lhstype, fns, complain_in,
/*template_only=*/true,
args, access_path);
}
case OVERLOAD:
case FUNCTION_DECL:
return
- resolve_address_of_overloaded_function (lhstype, rhs, flags_in,
+ resolve_address_of_overloaded_function (lhstype, rhs, complain_in,
/*template_only=*/false,
/*explicit_targs=*/NULL_TREE,
access_path);
case ADDR_EXPR:
{
if (PTRMEM_OK_P (rhs))
- flags |= tf_ptrmem_ok;
+ complain |= tf_ptrmem_ok;
- return instantiate_type (lhstype, TREE_OPERAND (rhs, 0), flags);
+ return instantiate_type (lhstype, TREE_OPERAND (rhs, 0), complain);
}
case ERROR_MARK: