]> git.ipfire.org Git - thirdparty/gcc.git/commit
Test procedure dummy arguments against global symbols, if available.
authorThomas Koenig <tkoenig@gcc.gnu.org>
Sat, 8 Feb 2025 14:18:21 +0000 (15:18 +0100)
committerThomas Koenig <tkoenig@gcc.gnu.org>
Sun, 9 Feb 2025 08:50:31 +0000 (09:50 +0100)
commita8d0a2dd6565ea15ce79d8af90f2671cbf9359c7
tree937f03ad3b913f306cac4bef200bb4afbb8c4890
parent9576353454e6c2a20a9742e2f29f17830766cd8a
Test procedure dummy arguments against global symbols, if available.

this fixes a rather old PR from 2005, where a subroutine
could be passed and called as a function.  This patch checks
for that, also for the reverse, and for wrong types of functions.

I expect that this will find a few bugs in dusty deck code...

gcc/fortran/ChangeLog:

PR fortran/24878
* interface.cc (compare_parameter): Check global subroutines
passed as actual arguments for subroutine / function and
function type.

gcc/testsuite/ChangeLog:

PR fortran/24878
* gfortran.dg/interface_51.f90: New test.
gcc/fortran/interface.cc
gcc/testsuite/gfortran.dg/interface_51.f90 [new file with mode: 0644]