Fortran : accepts pointer initialization of DT dummy args PR45337
authorMark Eggleston <markeggleston@gcc.gnu.org>
Wed, 10 Jun 2020 06:22:50 +0000 (07:22 +0100)
committerMark Eggleston <markeggleston@gcc.gnu.org>
Mon, 13 Jul 2020 15:38:07 +0000 (16:38 +0100)
commitbae66e0f04323ba9d5daf60fcb997de925100e3e
treeb85b125c62a1c0023f5ebbcfafc9c23f8dad4160
parent4fd124a23664c712f1bb1a7e91fa23fe83d72c0b
Fortran  : accepts pointer initialization of DT dummy args PR45337

Initialisation of a variable results in an implicit save attribute
being added to the variable.  The save attribute is not allowed for
variables with the dummy attribute set.  Initialisation should be
rejected for dummy variables.

2020-07-13  Mark Eggleston  <markeggleston@gcc.gnu.org>

gcc/fortran/

PR fortran/45337
* resolve.c (resolve_fl_variable): Remove type and intent
checks from the check for dummy.

2020-07-13  Mark Eggleston  <markeggleston@gcc.gnu.org>

gcc/testsuite/

PR fortran/45337
* gfortran.dg/pr45337_1.f90: New test.
* gfortran.dg/pr45337_2.f90: New test.
gcc/fortran/resolve.c
gcc/testsuite/gfortran.dg/pr45337_1.f90 [new file with mode: 0644]
gcc/testsuite/gfortran.dg/pr45337_2.f90 [new file with mode: 0644]