]> git.ipfire.org Git - thirdparty/gcc.git/commit
Fortran: Source allocation of pure function result rejected [PR119948]
authorPaul Thomas <pault@gcc.gnu.org>
Thu, 1 May 2025 14:22:54 +0000 (15:22 +0100)
committerJerry DeLisle <jvdelisle@gcc.gnu.org>
Wed, 25 Jun 2025 19:55:39 +0000 (12:55 -0700)
commit8422524f6f43263caca2c2ab8a0e890e92f5f114
tree07aa59e9588c355e289d7f81a530b0fedb6c573d
parentcb3c5b7d15cdb9373d102e7045c0823526a9c660
Fortran: Source allocation of pure function result rejected [PR119948]

2025-05-07  Paul Thomas  <pault@gcc.gnu.org>
    and Steven G. Kargl  <kargl@gcc.gnu.org>

gcc/fortran
PR fortran/119948
* resolve.cc (gfc_impure_variable): The result of a module
procedure with an interface declaration is not impure even if
the current namespace is not the same as the symbol's.
* primary.cc (match_variable): Module procedures with sym the
same as result can be treated as variables, although marked
external.

gcc/testsuite/
PR fortran/119948
* gfortran.dg/pr119948.f90: New test.

(cherry picked from commit 0abc77da9d704bba55a376bb5c162a54826ab94a)
gcc/fortran/primary.cc
gcc/fortran/resolve.cc
gcc/testsuite/gfortran.dg/pr119948.f90 [new file with mode: 0644]