]> git.ipfire.org Git - thirdparty/gcc.git/commit
Fortran: fix TARGET attribute of associating entity in ASSOCIATE [PR112764]
authorHarald Anlauf <anlauf@gmx.de>
Wed, 29 Nov 2023 20:47:24 +0000 (21:47 +0100)
committerHarald Anlauf <anlauf@gmx.de>
Thu, 30 Nov 2023 21:12:15 +0000 (22:12 +0100)
commitdd5d399fc16ebe7a1a2b13ae8cb888d619af695c
tree698f7adde6d3c41ae5d2291bcddf3429b0440054
parent741743c028dc00f27b9c8b1d5211c1f602f2fddd
Fortran: fix TARGET attribute of associating entity in ASSOCIATE [PR112764]

The associating entity in an ASSOCIATE construct has the TARGET attribute
if and only if the selector is a variable and has either the TARGET or
POINTER attribute (e.g. F2018:11.1.3.3).

gcc/fortran/ChangeLog:

PR fortran/112764
* primary.cc (gfc_variable_attr): Set TARGET attribute of associating
entity dependent on TARGET or POINTER attribute of selector.

gcc/testsuite/ChangeLog:

PR fortran/112764
* gfortran.dg/associate_62.f90: New test.

(cherry picked from commit 951a3e3749a9bf15cea3940ad4bd76d696e1b0b6)
gcc/fortran/primary.cc
gcc/testsuite/gfortran.dg/associate_62.f90 [new file with mode: 0644]