]> git.ipfire.org Git - thirdparty/gcc.git/commit - gcc/fortran/primary.cc
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 12:37:56 +0000 (13:37 +0100)
commit951a3e3749a9bf15cea3940ad4bd76d696e1b0b6
tree6e42208c8eeb2a562934fa52a63c30e9fbe6c0ca
parent2dde9f326ded84814a78c3044294b535c1f97b41
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.
gcc/fortran/primary.cc
gcc/testsuite/gfortran.dg/associate_62.f90 [new file with mode: 0644]