tree& parmtype, tree& argtype, tree& arg,
int flags, tsubst_flags_t complain)
{
- gcc_assert (DECL_NONSTATIC_MEMBER_FUNCTION_P (fn)
+ gcc_assert (DECL_IOBJ_MEMBER_FUNCTION_P (fn)
&& !DECL_CONSTRUCTOR_P (fn));
/* The type of the implicit object parameter ('this') for
{
tree parmtype = TREE_VALUE (parmnode);
if (i == 0
- && DECL_NONSTATIC_MEMBER_FUNCTION_P (fn)
+ && DECL_IOBJ_MEMBER_FUNCTION_P (fn)
&& !DECL_CONSTRUCTOR_P (fn))
t = build_this_conversion (fn, ctype, parmtype, argtype, arg,
flags, complain);
/* We don't do deduction on the in-charge parameter, the VTT
parameter or 'this'. */
- if (DECL_NONSTATIC_MEMBER_FUNCTION_P (tmpl))
+ if (DECL_IOBJ_MEMBER_FUNCTION_P (tmpl))
{
if (first_arg_without_in_chrg != NULL_TREE)
first_arg_without_in_chrg = NULL_TREE;
convs = alloc_conversions (nargs);
if (shortcut_bad_convs
- && DECL_NONSTATIC_MEMBER_FUNCTION_P (tmpl)
+ && DECL_IOBJ_MEMBER_FUNCTION_P (tmpl)
&& !DECL_CONSTRUCTOR_P (tmpl))
{
/* Check the 'this' conversion before proceeding with deduction.
tree fn_first_arg = NULL_TREE;
const vec<tree, va_gc> *fn_args = args;
- if (DECL_NONSTATIC_MEMBER_FUNCTION_P (fn))
+ if (DECL_OBJECT_MEMBER_FUNCTION_P (fn))
{
/* Figure out where the object arg comes from. If this
function is a non-static member and we didn't get an
type. If so, and if the class has no non-trivial bases or members,
be more permissive. */
if (current_function_decl
- && DECL_NONSTATIC_MEMBER_FUNCTION_P (current_function_decl)
+ && DECL_OBJECT_MEMBER_FUNCTION_P (current_function_decl)
+ /* ??? is_object_parameter? */
&& is_this_parameter (tree_strip_nop_conversions (dest)))
{
tree ctx = DECL_CONTEXT (current_function_decl);
tree parms2 = TYPE_ARG_TYPES (TREE_TYPE (fn2));
if (DECL_FUNCTION_MEMBER_P (fn1)
&& DECL_FUNCTION_MEMBER_P (fn2)
- && (DECL_NONSTATIC_MEMBER_FUNCTION_P (fn1)
- != DECL_NONSTATIC_MEMBER_FUNCTION_P (fn2)))
+ && (DECL_STATIC_FUNCTION_P (fn1)
+ != DECL_STATIC_FUNCTION_P (fn2)))
{
/* Ignore 'this' when comparing the parameters of a static member
function with those of a non-static one. */
print_z_candidate (input_location,
N_("candidate 2:"), l);
if (w->fn == l->fn
- && DECL_NONSTATIC_MEMBER_FUNCTION_P (w->fn)
+ && DECL_IOBJ_MEMBER_FUNCTION_P (w->fn)
&& (type_memfn_quals (TREE_TYPE (w->fn))
& TYPE_QUAL_CONST) == 0)
{
because R refers to one of the int elements of V, not to
a temporary object. Member operator* may return a reference
but probably not to one of its arguments. */
- || (DECL_NONSTATIC_MEMBER_FUNCTION_P (fndecl)
+ || (DECL_OBJECT_MEMBER_FUNCTION_P (fndecl)
&& DECL_OVERLOADED_OPERATOR_P (fndecl)
&& DECL_OVERLOADED_OPERATOR_IS (fndecl, INDIRECT_REF)))
return NULL_TREE;
tree arg = CALL_EXPR_ARG (expr, i);
/* Check that this argument initializes a reference, except for
the argument initializing the object of a member function. */
- if (!DECL_NONSTATIC_MEMBER_FUNCTION_P (fndecl)
+ if (!DECL_IOBJ_MEMBER_FUNCTION_P (fndecl)
&& !TYPE_REF_P (TREE_TYPE (arg)))
continue;
STRIP_NOPS (arg);
const S& s = S().self();
where 's' dangles. If we've gotten here, the object this function
is invoked on is not a temporary. */
- if (DECL_NONSTATIC_MEMBER_FUNCTION_P (fndecl))
+ if (DECL_OBJECT_MEMBER_FUNCTION_P (fndecl))
break;
}
return NULL_TREE;
for (fn = TYPE_FIELDS (t); fn; fn = DECL_CHAIN (fn))
if (TREE_CODE (fn) == FUNCTION_DECL
&& DECL_DECLARED_CONSTEXPR_P (fn)
- && DECL_NONSTATIC_MEMBER_FUNCTION_P (fn)
+ && DECL_IOBJ_MEMBER_FUNCTION_P (fn)
&& !DECL_CONSTRUCTOR_P (fn))
{
DECL_DECLARED_CONSTEXPR_P (fn) = false;
if (flag_openmp)
for (tree decl = TYPE_FIELDS (t); decl; decl = DECL_CHAIN (decl))
if (TREE_CODE (decl) == FUNCTION_DECL
- && DECL_NONSTATIC_MEMBER_FUNCTION_P (decl))
+ && DECL_OBJECT_MEMBER_FUNCTION_P (decl))
if (tree attr = lookup_attribute ("omp declare variant base",
DECL_ATTRIBUTES (decl)))
omp_declare_variant_finalize (decl, attr);
/* Good, exactly one match. Now, convert it to the correct type. */
fn = TREE_PURPOSE (matches);
- if (DECL_NONSTATIC_MEMBER_FUNCTION_P (fn)
+ if (DECL_OBJECT_MEMBER_FUNCTION_P (fn)
&& !(complain & tf_ptrmem_ok) && !flag_ms_extensions)
{
static int explained;
/* C++14 DR 1684 removed this restriction. */
if (cxx_dialect < cxx14
- && DECL_NONSTATIC_MEMBER_FUNCTION_P (fun)
+ && DECL_IOBJ_MEMBER_FUNCTION_P (fun)
&& !CLASSTYPE_LITERAL_P (DECL_CONTEXT (fun)))
{
ret = false;
non_constant_p, overflow_p);
/* Check we aren't dereferencing a null pointer when calling a non-static
member function, which is undefined behaviour. */
- if (i == 0 && DECL_NONSTATIC_MEMBER_FUNCTION_P (fun)
+ if (i == 0 && DECL_OBJECT_MEMBER_FUNCTION_P (fun)
&& integer_zerop (arg)
/* But ignore calls from within compiler-generated code, to handle
cases like lambda function pointer conversion operator thunks
{
if (TREE_TYPE (fndecl) == error_mark_node)
return error_mark_node;
- if (DECL_NONSTATIC_MEMBER_FUNCTION_P (fndecl)
+ if (DECL_IOBJ_MEMBER_FUNCTION_P (fndecl)
&& !TYPE_METHOD_BASETYPE (TREE_TYPE (fndecl)))
return error_mark_node;
arg_type && arg_type != void_list_node;
arg_type = TREE_CHAIN (arg_type))
{
- if (DECL_NONSTATIC_MEMBER_FUNCTION_P (fndecl)
+ if (DECL_IOBJ_MEMBER_FUNCTION_P (fndecl)
&& TYPE_ARG_TYPES (TREE_TYPE (fn)) == arg_type)
{
class_type = TREE_TYPE (TREE_VALUE (arg_type));
}
TREE_TYPE (fn) = build_function_type (value_type, arg_types);
- if (DECL_NONSTATIC_MEMBER_FUNCTION_P (fndecl))
+ if (DECL_IOBJ_MEMBER_FUNCTION_P (fndecl))
TREE_TYPE (fn) = build_method_type (class_type, TREE_TYPE (fn));
DECL_NAME (fn) = copy_node (DECL_NAME (fn));
case DW_AT_reference:
if (TREE_CODE (decl) == FUNCTION_DECL
- && DECL_NONSTATIC_MEMBER_FUNCTION_P (decl)
+ && DECL_IOBJ_MEMBER_FUNCTION_P (decl)
&& FUNCTION_REF_QUALIFIED (TREE_TYPE (decl))
&& !FUNCTION_RVALUE_QUALIFIED (TREE_TYPE (decl)))
return 1;
case DW_AT_rvalue_reference:
if (TREE_CODE (decl) == FUNCTION_DECL
- && DECL_NONSTATIC_MEMBER_FUNCTION_P (decl)
+ && DECL_IOBJ_MEMBER_FUNCTION_P (decl)
&& FUNCTION_REF_QUALIFIED (TREE_TYPE (decl))
&& FUNCTION_RVALUE_QUALIFIED (TREE_TYPE (decl)))
return 1;
unsigned coroutine_p : 1;
unsigned implicit_constexpr : 1;
unsigned escalated_p : 1;
+ unsigned xobj_func : 1;
- unsigned spare : 8;
+ unsigned spare : 7;
/* 32-bits padding on 64-bit host. */
#define DECL_STATIC_FUNCTION_P(NODE) \
(LANG_DECL_FN_CHECK (NODE)->static_function)
-/* Nonzero for FUNCTION_DECL means that this decl is a non-static
+/* Nonzero for FUNCTION_DECL means that this decl is a non-static member
+ function. C++23 explicit object member functions are also considered
+ non-static, but most former uses of this macro meant implicit object member
+ function. Instead of this macro, use DECL_IOBJ_MEMBER_FUNCTION_P or
+ DECL_OBJECT_MEMBER_FUNCTION_P. */
+#define DECL_NONSTATIC_MEMBER_FUNCTION_P(NODE) did_you_mean_object_or_iobj
+
+/* Nonzero for FUNCTION_DECL means that this decl is an implicit object
member function. */
-#define DECL_NONSTATIC_MEMBER_FUNCTION_P(NODE) \
+#define DECL_IOBJ_MEMBER_FUNCTION_P(NODE) \
(TREE_CODE (TREE_TYPE (NODE)) == METHOD_TYPE)
+/* Simple member access, only valid for FUNCTION_DECL nodes. */
+#define DECL_FUNCTION_XOBJ_FLAG(NODE) \
+ (LANG_DECL_FN_CHECK (NODE)->xobj_func)
+
+/* Nonzero if NODE is an xobj member function,
+ safely evaluates to false for all non FUNCTION_DECL nodes. */
+#define DECL_XOBJ_MEMBER_FUNCTION_P(NODE) \
+ (TREE_CODE (STRIP_TEMPLATE (NODE)) == FUNCTION_DECL \
+ && DECL_FUNCTION_XOBJ_FLAG (NODE) == 1)
+
+/* Nonzero if NODE is a member function with an object argument,
+ in other words, a non-static member function. */
+#define DECL_OBJECT_MEMBER_FUNCTION_P(NODE) \
+ (DECL_IOBJ_MEMBER_FUNCTION_P (NODE) || DECL_XOBJ_MEMBER_FUNCTION_P (NODE))
+
/* Nonzero for FUNCTION_DECL means that this decl is a member function
(static or non-static). */
#define DECL_FUNCTION_MEMBER_P(NODE) \
- (DECL_NONSTATIC_MEMBER_FUNCTION_P (NODE) || DECL_STATIC_FUNCTION_P (NODE))
+ (DECL_OBJECT_MEMBER_FUNCTION_P (NODE) || DECL_STATIC_FUNCTION_P (NODE)) \
/* Nonzero for FUNCTION_DECL means that this member function
has `this' as const X *const. */
#define DECL_CONST_MEMFUNC_P(NODE) \
- (DECL_NONSTATIC_MEMBER_FUNCTION_P (NODE) \
+ (DECL_IOBJ_MEMBER_FUNCTION_P (NODE) \
&& CP_TYPE_CONST_P (TREE_TYPE (TREE_VALUE \
(TYPE_ARG_TYPES (TREE_TYPE (NODE))))))
/* Nonzero for FUNCTION_DECL means that this member function
has `this' as volatile X *const. */
#define DECL_VOLATILE_MEMFUNC_P(NODE) \
- (DECL_NONSTATIC_MEMBER_FUNCTION_P (NODE) \
+ (DECL_IOBJ_MEMBER_FUNCTION_P (NODE) \
&& CP_TYPE_VOLATILE_P (TREE_TYPE (TREE_VALUE \
(TYPE_ARG_TYPES (TREE_TYPE (NODE))))))
/* Nonzero for a DECL means that this member is a non-static member. */
#define DECL_NONSTATIC_MEMBER_P(NODE) \
- (DECL_NONSTATIC_MEMBER_FUNCTION_P (NODE) \
+ (DECL_OBJECT_MEMBER_FUNCTION_P (NODE) \
|| TREE_CODE (NODE) == FIELD_DECL)
/* Nonzero for a FIELD_DECL means that this member object type
instantiation time. */
if (TREE_CODE (fun) != FUNCTION_DECL)
;
- else if (DECL_NONSTATIC_MEMBER_FUNCTION_P (fun))
+ else if (DECL_OBJECT_MEMBER_FUNCTION_P (fun))
{
tree object = (code == AGGR_INIT_EXPR
? (AGGR_INIT_VIA_CTOR_P (t)
do not have a type-specifier in their return types. */
if (DECL_CONSTRUCTOR_P (t) || DECL_CONV_FN_P (t))
function_specifier (t);
- else if (DECL_NONSTATIC_MEMBER_FUNCTION_P (t))
+ else if (DECL_IOBJ_MEMBER_FUNCTION_P (t))
declaration_specifiers (TREE_TYPE (TREE_TYPE (t)));
else
c_pretty_printer::declaration_specifiers (t);
expression (t);
pp_cxx_parameter_declaration_clause (this, t);
- if (DECL_NONSTATIC_MEMBER_FUNCTION_P (t))
+ if (DECL_IOBJ_MEMBER_FUNCTION_P (t))
{
padding = pp_before;
pp_cxx_cv_qualifier_seq (this, pp_cxx_implicit_parameter_type (t));
&& TREE_CODE (decl) == FUNCTION_DECL
/* #pragma omp declare variant on methods handled in finish_struct
instead. */
- && (!DECL_NONSTATIC_MEMBER_FUNCTION_P (decl)
+ && (!DECL_OBJECT_MEMBER_FUNCTION_P (decl)
|| COMPLETE_TYPE_P (DECL_CONTEXT (decl))))
if (tree attr = lookup_attribute ("omp declare variant base",
DECL_ATTRIBUTES (decl)))
tree class_type;
if (TREE_CODE (decl) == USING_DECL
- || !DECL_NONSTATIC_MEMBER_FUNCTION_P (decl))
+ || !DECL_OBJECT_MEMBER_FUNCTION_P (decl))
return;
class_type = DECL_CONTEXT (decl);
/* Start the statement-tree, start the tree now. */
DECL_SAVED_TREE (decl1) = push_stmt_list ();
- if (DECL_NONSTATIC_MEMBER_FUNCTION_P (decl1))
+ if (DECL_IOBJ_MEMBER_FUNCTION_P (decl1))
{
/* We know that this was set up by `grokclassfn'. We do not
wait until `store_parm_decls', since evil parse errors may
static void
record_key_method_defined (tree fndecl)
{
- if (DECL_NONSTATIC_MEMBER_FUNCTION_P (fndecl)
+ if (DECL_OBJECT_MEMBER_FUNCTION_P (fndecl)
&& DECL_VIRTUAL_P (fndecl)
&& !processing_template_decl)
{
if (cxx_dialect >= cxx11
&& DECL_P (decl)
&& DECL_ARTIFICIAL (decl)
- && DECL_NONSTATIC_MEMBER_FUNCTION_P (decl)
+ && DECL_IOBJ_MEMBER_FUNCTION_P (decl)
&& copy_fn_p (decl))
{
/* Don't warn if the flag was disabled around the class definition
else if (code == CALL_EXPR)
{
tree fn = get_callee_fndecl (init);
- if (fn && DECL_NONSTATIC_MEMBER_FUNCTION_P (fn))
+ if (fn && DECL_IOBJ_MEMBER_FUNCTION_P (fn))
{
tree op = CALL_EXPR_ARG (init, 0);
if (TREE_CODE (op) == ADDR_EXPR)
-- in a mem-initializer for a constructor for that class or for
a class derived from that class (_class.base.init_). */
- if (DECL_NONSTATIC_MEMBER_FUNCTION_P (member))
+ if (DECL_OBJECT_MEMBER_FUNCTION_P (member))
{
/* Build a representation of the qualified name suitable
for use as the operand to "&" -- even though the "&" is
if (!LAMBDA_FUNCTION_P (containing_function))
{
- /* We found a non-lambda function. */
- if (DECL_NONSTATIC_MEMBER_FUNCTION_P (containing_function))
+ /* We found a non-lambda function.
+ There is no this pointer in xobj member functions. */
+ if (DECL_IOBJ_MEMBER_FUNCTION_P (containing_function))
/* First parameter is 'this'. */
init = DECL_ARGUMENTS (containing_function);
break;
for (lkp_iterator iter (fns); iter; ++iter)
if (((!id_expr && TREE_CODE (*iter) != USING_DECL)
|| TREE_CODE (*iter) == TEMPLATE_DECL)
- && DECL_NONSTATIC_MEMBER_FUNCTION_P (*iter))
+ && DECL_IOBJ_MEMBER_FUNCTION_P (*iter))
{
/* Found a non-static member. Capture this. */
lambda_expr_this_capture (lam, /*maybe*/-1);
tree fn = TYPE_CONTEXT (type);
if (!fn || TREE_CODE (fn) != FUNCTION_DECL
- || !DECL_NONSTATIC_MEMBER_FUNCTION_P (fn))
+ || !DECL_IOBJ_MEMBER_FUNCTION_P (fn))
/* No enclosing non-lambda method. */
return NULL_TREE;
if (!LAMBDA_FUNCTION_P (fn))
write_char ('N');
- /* Write CV-qualifiers, if this is a member function. */
+ /* Write CV-qualifiers, if this is an iobj member function. */
if (TREE_CODE (decl) == FUNCTION_DECL
- && DECL_NONSTATIC_MEMBER_FUNCTION_P (decl))
+ && DECL_IOBJ_MEMBER_FUNCTION_P (decl))
{
if (DECL_VOLATILE_MEMFUNC_P (decl))
write_char ('V');
ok = false;
}
- bool mem = DECL_NONSTATIC_MEMBER_FUNCTION_P (fn);
+ bool mem = DECL_IOBJ_MEMBER_FUNCTION_P (fn);
if (mem && type_memfn_quals (TREE_TYPE (fn)) != TYPE_QUAL_CONST)
{
error_at (loc, "defaulted %qD must be %<const%>", fn);
if (saw_bad || (saw_byval && saw_byref))
{
- if (DECL_NONSTATIC_MEMBER_FUNCTION_P (fn))
+ if (DECL_IOBJ_MEMBER_FUNCTION_P (fn))
error_at (loc, "defaulted member %qD must have parameter type "
"%<const %T&%>", fn, ctx);
else if (saw_bad)
tree
skip_artificial_parms_for (const_tree fn, tree list)
{
- if (DECL_NONSTATIC_MEMBER_FUNCTION_P (fn))
+ if (DECL_IOBJ_MEMBER_FUNCTION_P (fn))
list = TREE_CHAIN (list);
else
return list;
{
int count = 0;
- if (DECL_NONSTATIC_MEMBER_FUNCTION_P (fn))
+ if (DECL_IOBJ_MEMBER_FUNCTION_P (fn))
count++;
else
return 0;
WB (lang->u.fn.has_dependent_explicit_spec_p);
WB (lang->u.fn.immediate_fn_p);
WB (lang->u.fn.maybe_deleted);
- WB (lang->u.fn.escalated_p);
/* We do not stream lang->u.fn.implicit_constexpr. */
+ WB (lang->u.fn.escalated_p);
+ WB (lang->u.fn.xobj_func);
goto lds_min;
case lds_decomp: /* lang_decl_decomp. */
RB (lang->u.fn.has_dependent_explicit_spec_p);
RB (lang->u.fn.immediate_fn_p);
RB (lang->u.fn.maybe_deleted);
- RB (lang->u.fn.escalated_p);
/* We do not stream lang->u.fn.implicit_constexpr. */
+ RB (lang->u.fn.escalated_p);
+ RB (lang->u.fn.xobj_func);
goto lds_min;
case lds_decomp: /* lang_decl_decomp. */
`this' parameter. */
friend_args_type = TYPE_ARG_TYPES (friend_type);
decl_args_type = TYPE_ARG_TYPES (decl_type);
- if (DECL_NONSTATIC_MEMBER_FUNCTION_P (friend_decl))
+ if (DECL_IOBJ_MEMBER_FUNCTION_P (friend_decl))
friend_args_type = TREE_CHAIN (friend_args_type);
- if (DECL_NONSTATIC_MEMBER_FUNCTION_P (decl))
+ if (DECL_IOBJ_MEMBER_FUNCTION_P (decl))
decl_args_type = TREE_CHAIN (decl_args_type);
return compparms (decl_args_type, friend_args_type);
that the const qualification is the same. Since
get_bindings does not try to merge the "this" parameter,
we must do the comparison explicitly. */
- if (DECL_NONSTATIC_MEMBER_FUNCTION_P (fn))
+ if (DECL_IOBJ_MEMBER_FUNCTION_P (fn))
{
if (!same_type_p (TREE_VALUE (fn_arg_types),
TREE_VALUE (decl_arg_types)))
/* Adjust the type of DECL in case FN is a static member. */
decl_arg_types = TYPE_ARG_TYPES (TREE_TYPE (decl));
if (DECL_STATIC_FUNCTION_P (fn)
- && DECL_NONSTATIC_MEMBER_FUNCTION_P (decl))
+ && DECL_IOBJ_MEMBER_FUNCTION_P (decl))
decl_arg_types = TREE_CHAIN (decl_arg_types);
if (!compparms (TYPE_ARG_TYPES (TREE_TYPE (fn)),
decl_arg_types))
continue;
- if (DECL_NONSTATIC_MEMBER_FUNCTION_P (fn)
+ if (DECL_IOBJ_MEMBER_FUNCTION_P (fn)
&& (type_memfn_rqual (TREE_TYPE (decl))
!= type_memfn_rqual (TREE_TYPE (fn))))
continue;
old_type = TREE_TYPE (decl);
spec_types = TYPE_ARG_TYPES (old_type);
- if (DECL_NONSTATIC_MEMBER_FUNCTION_P (decl))
+ if (DECL_IOBJ_MEMBER_FUNCTION_P (decl))
{
/* Remove the this pointer, but remember the object's type for
CV quals. */
make DECL a static member function as well. */
if (DECL_FUNCTION_TEMPLATE_P (tmpl)
&& DECL_STATIC_FUNCTION_P (tmpl)
- && DECL_NONSTATIC_MEMBER_FUNCTION_P (decl))
+ && DECL_IOBJ_MEMBER_FUNCTION_P (decl))
revert_static_member_fn (decl);
/* If this is a specialization of a member template of a
/* For member functions, make this available for semantic analysis. */
tree save_ccp = current_class_ptr;
tree save_ccr = current_class_ref;
- if (DECL_NONSTATIC_MEMBER_FUNCTION_P (decl))
+ if (DECL_IOBJ_MEMBER_FUNCTION_P (decl))
{
tree arg_types = TYPE_ARG_TYPES (TREE_TYPE (decl));
tree this_type = TREE_TYPE (TREE_VALUE (arg_types));
{
/* Non-constructor methods need to leave a conversion for 'this', which
isn't included in nargs here. */
- unsigned offset = (DECL_NONSTATIC_MEMBER_FUNCTION_P (fn)
+ unsigned offset = (DECL_IOBJ_MEMBER_FUNCTION_P (fn)
&& !DECL_CONSTRUCTOR_P (fn));
for (unsigned ia = 0;
I think think the old G++ behavior of just skipping the object
parameter when comparing to a static member function was better, so
let's stick with that for now. This is CWG2834. --jason 2023-12 */
- if (DECL_NONSTATIC_MEMBER_FUNCTION_P (decl1)) /* FIXME or explicit */
+ if (DECL_OBJECT_MEMBER_FUNCTION_P (decl1))
{
len--; /* LEN is the number of significant arguments for DECL1 */
args1 = TREE_CHAIN (args1);
}
- else if (DECL_NONSTATIC_MEMBER_FUNCTION_P (decl2)) /* FIXME or explicit */
+ else if (DECL_OBJECT_MEMBER_FUNCTION_P (decl2))
args2 = TREE_CHAIN (args2);
}
- else if (DECL_NONSTATIC_MEMBER_FUNCTION_P (decl1) /* FIXME implicit only */
- && DECL_NONSTATIC_MEMBER_FUNCTION_P (decl2))
+ else if (DECL_IOBJ_MEMBER_FUNCTION_P (decl1)
+ && DECL_IOBJ_MEMBER_FUNCTION_P (decl2))
{
/* Note DR2445 also (IMO wrongly) removed the "only one" above, which
would break e.g. cpp1y/lambda-generic-variadic5.C. */
args1 = TREE_CHAIN (args1);
args2 = TREE_CHAIN (args2);
}
- else if (DECL_NONSTATIC_MEMBER_FUNCTION_P (decl1) /* FIXME implicit only */
- || DECL_NONSTATIC_MEMBER_FUNCTION_P (decl2))
+ else if (DECL_IOBJ_MEMBER_FUNCTION_P (decl1)
+ || DECL_IOBJ_MEMBER_FUNCTION_P (decl2))
{
/* The other is a non-member or explicit object member function;
rewrite the implicit object parameter to a reference. */
- tree ns = DECL_NONSTATIC_MEMBER_FUNCTION_P (decl2) ? decl2 : decl1;
+ tree ns = DECL_IOBJ_MEMBER_FUNCTION_P (decl2) ? decl2 : decl1;
tree &nsargs = ns == decl2 ? args2 : args1;
tree obtype = TREE_TYPE (TREE_VALUE (nsargs));
push_deferring_access_checks (dk_no_deferred);
input_location = DECL_SOURCE_LOCATION (fn);
- if (DECL_NONSTATIC_MEMBER_FUNCTION_P (fn)
+ if (DECL_IOBJ_MEMBER_FUNCTION_P (fn)
&& !DECL_LOCAL_DECL_P (fn))
{
/* If needed, set current_class_ptr for the benefit of
{
tree tmpl_parm = DECL_ARGUMENTS (pattern);
tree spec_parm = DECL_ARGUMENTS (inst);
- if (DECL_NONSTATIC_MEMBER_FUNCTION_P (inst))
+ if (DECL_IOBJ_MEMBER_FUNCTION_P (inst))
{
register_local_specialization (spec_parm, tmpl_parm);
spec_parm = skip_artificial_parms_for (inst, spec_parm);
cause the call to be considered value-dependent. We also
look through it in potential_constant_expression. */
if (i == 0 && fn && DECL_DECLARED_CONSTEXPR_P (fn)
- && DECL_NONSTATIC_MEMBER_FUNCTION_P (fn)
+ && DECL_IOBJ_MEMBER_FUNCTION_P (fn)
&& TREE_CODE (op) == ADDR_EXPR)
op = TREE_OPERAND (op, 0);
if (value_dependent_expression_p (op))
/* Conservatively assume a dependent using-declaration
might resolve to a non-static member. */
return false;
- if (DECL_NONSTATIC_MEMBER_FUNCTION_P (decl))
+ if (DECL_OBJECT_MEMBER_FUNCTION_P (decl))
return false;
}
return true;
decl = strip_using_decl (decl);
/* A dependent USING_DECL will be checked after tsubsting. */
if (TREE_CODE (decl) != USING_DECL
- && !DECL_NONSTATIC_MEMBER_FUNCTION_P (decl)
+ && !DECL_IOBJ_MEMBER_FUNCTION_P (decl)
&& !perform_or_defer_access_check (basetype_path, decl, decl,
complain, afi))
return error_mark_node;
return false;
tree ptr = STRIP_NOPS (TREE_OPERAND (indirect_ref, 0));
+ /* ??? is_object_parameter? */
if (!is_this_parameter (ptr))
return false;
for (tree x = TYPE_FIELDS (t); x; x = DECL_CHAIN (x))
{
if (TREE_CODE (x) == USING_DECL
- || !DECL_NONSTATIC_MEMBER_FUNCTION_P (x))
+ || !DECL_IOBJ_MEMBER_FUNCTION_P (x))
continue;
tree ods = lookup_attribute ("omp declare simd", DECL_ATTRIBUTES (x));
if (!ods || !TREE_VALUE (ods))
case FUNCTION_DECL:
/* All functions (except non-static-member functions) are
lvalues. */
- return (DECL_NONSTATIC_MEMBER_FUNCTION_P (ref)
+ return (DECL_IOBJ_MEMBER_FUNCTION_P (ref)
? clk_none : clk_ordinary);
case BASELINK:
if (is_overloaded_fn (expr) && !really_overloaded_fn (expr))
expr = get_first_fn (expr);
if (TREE_TYPE (expr)
- && DECL_NONSTATIC_MEMBER_FUNCTION_P (expr))
+ && DECL_IOBJ_MEMBER_FUNCTION_P (expr))
{
if (complain & tf_error)
{
}
}
- if (unchanged_cfun || DECL_NONSTATIC_MEMBER_FUNCTION_P (changed_func_decl))
+ if (unchanged_cfun || DECL_OBJECT_MEMBER_FUNCTION_P (changed_func_decl))
{
/* Check whether the oracle supplies us with a "this", and if
so, arrange for data members and this itself to be