]> gcc.gnu.org Git - gcc.git/commit
Fortran: allow RESTRICT qualifier also for optional arguments [PR100988]
authorHarald Anlauf <anlauf@gmx.de>
Mon, 4 Dec 2023 21:44:53 +0000 (22:44 +0100)
committerHarald Anlauf <anlauf@gmx.de>
Fri, 15 Mar 2024 20:24:56 +0000 (21:24 +0100)
commit337dc58139595bd9ab4101b988078c5d54d8506a
tree9df324ba0d61133b881270bf47cbdae23869da8b
parent90442fb421823153c4f762a2d26a0d700af2e6c3
Fortran: allow RESTRICT qualifier also for optional arguments [PR100988]

gcc/fortran/ChangeLog:

PR fortran/100988
* gfortran.h (IS_PROC_POINTER): New macro.
* trans-types.cc (gfc_sym_type): Use macro in determination if the
restrict qualifier can be used for a dummy variable.  Fix logic to
allow the restrict qualifier also for optional arguments, and to
not apply it to pointer or proc_pointer arguments.

gcc/testsuite/ChangeLog:

PR fortran/100988
* gfortran.dg/coarray_poly_6.f90: Adjust pattern.
* gfortran.dg/coarray_poly_7.f90: Likewise.
* gfortran.dg/coarray_poly_8.f90: Likewise.
* gfortran.dg/missing_optional_dummy_6a.f90: Likewise.
* gfortran.dg/pr100988.f90: New test.

Co-authored-by: Tobias Burnus <tobias@codesourcery.com>
(cherry picked from commit 9c3a880feecf81c310b4ade210fbd7004c9aece7)
gcc/fortran/gfortran.h
gcc/fortran/trans-types.cc
gcc/testsuite/gfortran.dg/coarray_poly_6.f90
gcc/testsuite/gfortran.dg/coarray_poly_7.f90
gcc/testsuite/gfortran.dg/coarray_poly_8.f90
gcc/testsuite/gfortran.dg/missing_optional_dummy_6a.f90
gcc/testsuite/gfortran.dg/pr100988.f90 [new file with mode: 0644]
This page took 0.069274 seconds and 6 git commands to generate.