https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93289

--- Comment #3 from Tobias Burnus <burnus at gcc dot gnu.org> ---
Okay, it is indeed a -std=gnu extension. I still regard it as bug that it
differs, but we can now think about which one to change. Namely:


In the always-error case (i.e. literal first):
* gfc_resolve_character_array_constructor
  …
  if (expr->ts.u.cl->length == NULL)
  …
          else if (found_length != current_length)
            {
              gfc_error ("Different CHARACTER lengths (%ld/%ld) in array"
                         " constructor at %L", (long) found_length,

In the other case, one has:

* gfc_resolve_character_array_constructor
  …
  if (expr->ts.u.cl->length == NULL)
  …
  else
  …
                gfc_set_constant_character_len (found_length, p->expr,
                                                has_ts ? -1 : current_length);

And in gfc_set_constant_character_len:

      if (check_len != -1 && slen != check_len
          && !(gfc_option.allow_std & GFC_STD_GNU))
        gfc_error_now ("The CHARACTER elements of the array constructor "
                       "at %L must have the same length (%ld/%ld)",

Reply via email to