Hello,
Le 20/04/2023 à 22:01, Harald Anlauf via Fortran a écrit :
Dear all,
Fortran 2018 added a clarification that the *result* of a function
whose result *variable* has the ALLOCATABLE attribute is a *value*
that itself does not have the ALLOCATABLE attribute.
For those interested: there was a thread on the J3 mailing list
some time ago (for links see the PR).
The patch which implements a related check was co-authored with
Steve and regtested by him. Testcase verified against NAG.
OK for mainline (gcc-14)?
Looks good in principle, but I think the real fix should be in the
gfc_expr_attr function, which copies all the attributes (including
allocatable) in the EXPR_FUNCTION case. How would the testsuite react
if that attribute was cleared there? Is your patch still needed if
gfc_expr_attr is fixed?
Mikael