+2020-02-01 Jakub Jelinek <jakub@redhat.com>
+
+ PR fortran/92305
+ * trans-types.c (gfc_get_function_type): Also push boolean_type_node
+ types for non-character scalar VALUE optional dummy arguments.
+ * trans-decl.c (create_function_arglist): Skip those in
+ hidden_typelist. Formatting fix.
+
2020-01-31 Tobias Burnus <tobias@codesourcery.com>
PR fortran/93462
|| f->sym->ts.u.cl->backend_decl == length)
{
if (POINTER_TYPE_P (len_type))
- f->sym->ts.u.cl->backend_decl =
- build_fold_indirect_ref_loc (input_location, length);
+ f->sym->ts.u.cl->backend_decl
+ = build_fold_indirect_ref_loc (input_location, length);
else if (f->sym->ts.u.cl->backend_decl == NULL)
gfc_create_string_length (f->sym);
DECL_ARG_TYPE (tmp) = boolean_type_node;
TREE_READONLY (tmp) = 1;
gfc_finish_decl (tmp);
+
+ hidden_typelist = TREE_CHAIN (hidden_typelist);
}
/* For non-constant length array arguments, make sure they use
vec_safe_push (typelist, type);
}
+ /* For noncharacter scalar intrinsic types, VALUE passes the value,
+ hence, the optional status cannot be transferred via a NULL pointer.
+ Thus, we will use a hidden argument in that case. */
+ else if (arg
+ && arg->attr.optional
+ && arg->attr.value
+ && !arg->attr.dimension
+ && arg->ts.type != BT_CLASS
+ && !gfc_bt_struct (arg->ts.type))
+ vec_safe_push (typelist, boolean_type_node);
}
if (!vec_safe_is_empty (typelist)