+2017-11-07 Jakub Jelinek <jakub@redhat.com>
+
+ PR c++/82835
+ * cp-gimplify.c (cxx_omp_clause_apply_fn): For methods pass i - 1 to
+ convert_default_arg instead of i.
+
2017-11-06 Jason Merrill <jason@redhat.com>
P0704R1 - fixing const-qualified pointers to members
if (arg2)
defparm = TREE_CHAIN (defparm);
+ bool is_method = TREE_CODE (TREE_TYPE (fn)) == METHOD_TYPE;
if (TREE_CODE (TREE_TYPE (arg1)) == ARRAY_TYPE)
{
tree inner_type = TREE_TYPE (arg1);
for (parm = defparm; parm && parm != void_list_node;
parm = TREE_CHAIN (parm), i++)
argarray[i] = convert_default_arg (TREE_VALUE (parm),
- TREE_PURPOSE (parm), fn, i,
- tf_warning_or_error);
+ TREE_PURPOSE (parm), fn,
+ i - is_method, tf_warning_or_error);
t = build_call_a (fn, i, argarray);
t = fold_convert (void_type_node, t);
t = fold_build_cleanup_point_expr (TREE_TYPE (t), t);
for (parm = defparm; parm && parm != void_list_node;
parm = TREE_CHAIN (parm), i++)
argarray[i] = convert_default_arg (TREE_VALUE (parm),
- TREE_PURPOSE (parm),
- fn, i, tf_warning_or_error);
+ TREE_PURPOSE (parm), fn,
+ i - is_method, tf_warning_or_error);
t = build_call_a (fn, i, argarray);
t = fold_convert (void_type_node, t);
return fold_build_cleanup_point_expr (TREE_TYPE (t), t);