mpz_clear (offset);
gcc_assert (repeat == NULL);
+ /* Overwriting an existing initializer is non-standard but usually only
+ provokes a warning from other compilers. */
+ if (init != NULL && init->where.lb && rvalue->where.lb)
+ {
+ /* Order in which the expressions arrive here depends on whether
+ they are from data statements or F95 style declarations.
+ Therefore, check which is the most recent. */
+ expr = (LOCATION_LINE (init->where.lb->location)
+ > LOCATION_LINE (rvalue->where.lb->location))
+ ? init : rvalue;
+ if (gfc_notify_std (GFC_STD_GNU, "re-initialization of %qs at %L",
+ symbol->name, &expr->where) == false)
+ return false;
+ }
+
if (ref || last_ts->type == BT_CHARACTER)
{
/* An initializer has to be constant. */
return false;
}
- /* Overwriting an existing initializer is non-standard but usually only
- provokes a warning from other compilers. */
- if (init != NULL)
- {
- /* Order in which the expressions arrive here depends on whether
- they are from data statements or F95 style declarations.
- Therefore, check which is the most recent. */
- expr = (LOCATION_LINE (init->where.lb->location)
- > LOCATION_LINE (rvalue->where.lb->location))
- ? init : rvalue;
- if (gfc_notify_std (GFC_STD_GNU,
- "re-initialization of %qs at %L",
- symbol->name, &expr->where) == false)
- return false;
- }
-
expr = gfc_copy_expr (rvalue);
if (!gfc_compare_types (&lvalue->ts, &expr->ts))
gfc_convert_type (expr, &lvalue->ts, 0);
+2018-06-09 Steven G. Kargl <kargl@gcc.gnu.org>
+
+ PR fortran/78278
+ * gfortran.dg/data_bounds_1.f90: Add -std=gnu option.
+ * gfortran.dg/data_char_1.f90: Ditto.
+ * gfortran.dg/pr78571.f90: Ditto.
+ * gfortran.dg/pr78278.f90: New test.
+
2018-06-09 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/63514