]> git.feebdaed.xyz Git - 0xmirror/gcc.git/commit
Fortran: fix variable definition context checks for SELECT TYPE [PR123253]
authorHarald Anlauf <anlauf@gmx.de>
Mon, 22 Dec 2025 20:05:29 +0000 (21:05 +0100)
committerHarald Anlauf <anlauf@gmx.de>
Mon, 22 Dec 2025 21:43:37 +0000 (22:43 +0100)
commit692ca18d491ec2337f50a1788866106dcb597901
tree6b80f6a07052c2bde37c87a7800189f358a7e52b
parentee4a808fdab1b7a83636a64dff633b0bff849629
Fortran: fix variable definition context checks for SELECT TYPE [PR123253]

Commit r16-6300 introduced a regression when checking the variable
definition context of SELECT TYPE variables where the selector was not a
dummy argument as the scan for the association target was too shallow.
Scan through association lists for the ultimate selector.

PR fortran/123253

gcc/fortran/ChangeLog:

* expr.cc (gfc_check_vardef_context): Replace simple check by a
scan through the association targets for a dummy argument.

gcc/testsuite/ChangeLog:

* gfortran.dg/associate_76.f90: Extended testcase.
* gfortran.dg/associate_77.f90: New test.
gcc/fortran/expr.cc
gcc/testsuite/gfortran.dg/associate_76.f90
gcc/testsuite/gfortran.dg/associate_77.f90 [new file with mode: 0644]