Fortran: fix check for pointer dummy arguments with INTENT(IN)
authorHarald Anlauf <anlauf@gmx.de>
Thu, 9 Dec 2021 21:57:13 +0000 (22:57 +0100)
committerHarald Anlauf <anlauf@gmx.de>
Fri, 10 Dec 2021 17:53:09 +0000 (18:53 +0100)
commitbb6a1ebb8585b85879735d0d6df9535885fad165
treef9c186dabaacf7ae6f1f7693c2e1c5e06ab42971
parent982a2c9b7866558039df61b0596caad57c94c8c4
Fortran: fix check for pointer dummy arguments with INTENT(IN)

gcc/fortran/ChangeLog:

PR fortran/103418
* check.c (variable_check): Replace previous check of procedure
dummy arguments with INTENT(IN) attribute when passed to intrinsic
procedures by gfc_check_vardef_context.
* expr.c (gfc_check_vardef_context): Correct check of INTENT(IN)
dummy arguments for the case of sub-components of a CLASS pointer.

gcc/testsuite/ChangeLog:

PR fortran/103418
* gfortran.dg/move_alloc_8.f90: Adjust error messages.
* gfortran.dg/pointer_intent_9.f90: New test.
gcc/fortran/check.c
gcc/fortran/expr.c
gcc/testsuite/gfortran.dg/move_alloc_8.f90
gcc/testsuite/gfortran.dg/pointer_intent_9.f90 [new file with mode: 0644]