On 10/13/20 10:17 PM, Harald Anlauf wrote:

The KIND argument to intrinsics must be a compile-time argument.
Improve check so that the proper diagnostics is emitted.


-  if (!gfc_check_init_expr (k))
+  if (!gfc_check_init_expr (k) || k->expr_type == EXPR_VARIABLE)

I think the real question is why is the following regarded as initialization 
expression:
      t = true;
…
      if (gfc_check_iter_variable (e))
        break;

Or worded differently: If
  integer, parameter :: A(*) = [(i, i=1,5)]
is valid, which should
  integer, parameter :: B(*) = [integer :: (int(i, kind=i), i=1,2)]
be invalid?

And, indeed, the Intel Fortran compiler does accept the code:
https://godbolt.org/z/EKbTf1
(While FLANG like gfortran does not.)

Thus, the first question should be whether that is valid code
according to the Fortran standard or not.

Tobias

-----------------
Mentor Graphics (Deutschland) GmbH, Arnulfstraße 201, 80634 München / Germany
Registergericht München HRB 106955, Geschäftsführer: Thomas Heurung, Alexander 
Walter

Reply via email to