Re: Aw: Re: [PATCH] PR fortran/97408 - Diagnose non-constant KIND argument to intrinsics

2020-10-14 Thread Tobias Burnus
Hi Harald, On 10/14/20 8:25 PM, Harald Anlauf wrote: 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? Well, my copy of the F2018-FDIS says about the KIND argument to I

Aw: Re: [PATCH] PR fortran/97408 - Diagnose non-constant KIND argument to intrinsics

2020-10-14 Thread Harald Anlauf
Hi Tobias, > > 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 t

Re: [PATCH] PR fortran/97408 - Diagnose non-constant KIND argument to intrinsics

2020-10-13 Thread Tobias Burnus
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

[PATCH] PR fortran/97408 - Diagnose non-constant KIND argument to intrinsics

2020-10-13 Thread Harald Anlauf
While looking at some other PR, I found the urgent need for a rather obvious improvement to compile-time diagnostics: The KIND argument to intrinsics must be a compile-time constant. Regtested on x86_64-pc-linux-gnu. OK for master? Thanks, Harald PR fortran/97408 - Diagnose non-constant KIND a