gfc_actual_arglist *ap;
gfc_intrinsic_sym* isym = NULL;
+
if (p == NULL)
return true;
gfc_constructor_base ctor;
gfc_constructor *args[5] = {}; /* Avoid uninitialized warnings. */
gfc_constructor *ci, *new_ctor;
- gfc_expr *expr, *old;
+ gfc_expr *expr, *old, *p;
int n, i, rank[5], array_arg;
- int errors = 0;
if (e == NULL)
return false;
n++;
}
- gfc_get_errors (NULL, &errors);
-
/* Using the array argument as the master, step through the array
calling the function for each element and advancing the array
constructors together. */
/* Simplify the function calls. If the simplification fails, the
error will be flagged up down-stream or the library will deal
with it. */
- if (errors == 0)
- gfc_simplify_expr (new_ctor->expr, 0);
+ p = gfc_copy_expr (new_ctor->expr);
+
+ if (!gfc_simplify_expr (p, init_flag))
+ gfc_free_expr (p);
+ else
+ gfc_replace_expr (new_ctor->expr, p);
for (i = 0; i < n; i++)
if (args[i])
/* Check size of array assignments. */
if (lvalue->rank != 0 && rvalue->rank != 0
- && !gfc_check_conformance (lvalue, rvalue, "array assignment"))
+ && !gfc_check_conformance (lvalue, rvalue, _("array assignment")))
return false;
/* Handle the case of a BOZ literal on the RHS. */
contiguous. Be lenient in the definition of what counts as
contiguous. */
- if (lhs_attr.contiguous && !gfc_is_simply_contiguous (rvalue, false, true))
+ if (lhs_attr.contiguous
+ && lhs_attr.dimension > 0
+ && !gfc_is_simply_contiguous (rvalue, false, true))
gfc_warning (OPT_Wextra, "Assignment to contiguous pointer from "
"non-contiguous target at %L", &rvalue->where);