]> git.ipfire.org Git - thirdparty/gcc.git/commit
Fortran: function results never have the ALLOCATABLE attribute [PR109500]
authorHarald Anlauf <anlauf@gmx.de>
Thu, 20 Apr 2023 19:47:34 +0000 (21:47 +0200)
committerHarald Anlauf <anlauf@gmx.de>
Sat, 22 Apr 2023 18:22:54 +0000 (20:22 +0200)
commiteb385a4801c45a1c0574810b45fce9e712d34566
tree61e031ffdc3a065db86a30340ff51d494aa9baf3
parent7a0cbaf7f802df209840d78740ffc749dadd1ce3
Fortran: function results never have the ALLOCATABLE attribute [PR109500]

Fortran 2018 8.5.3 (ALLOCATABLE attribute) explains in Note 1 that the
result of referencing a function whose result variable has the ALLOCATABLE
attribute is a value that does not itself have the ALLOCATABLE attribute.

gcc/fortran/ChangeLog:

PR fortran/109500
* interface.cc (gfc_compare_actual_formal): Reject allocatable
functions being used as actual argument for allocable dummy.

gcc/testsuite/ChangeLog:

PR fortran/109500
* gfortran.dg/allocatable_function_11.f90: New test.

Co-authored-by: Steven G. Kargl <kargl@gcc.gnu.org>
gcc/fortran/interface.cc
gcc/testsuite/gfortran.dg/allocatable_function_11.f90 [new file with mode: 0644]