]> gcc.gnu.org Git - gcc.git/commit
Fortran: fix passing of NULL() actual argument to character dummy [PR104819]
authorHarald Anlauf <anlauf@gmx.de>
Thu, 14 Nov 2024 20:38:04 +0000 (21:38 +0100)
committerHarald Anlauf <anlauf@gmx.de>
Thu, 14 Nov 2024 21:37:56 +0000 (22:37 +0100)
commitf70c1d517e09c4dde421774a8cec591ca3c479a0
treeb8c21563762b493772549ba83764a313fb146669
parent7744da67e95824e15de5773e608aeb3d2bbd8653
Fortran: fix passing of NULL() actual argument to character dummy [PR104819]

Ensure that character length is set and passed by the call to a procedure
when its dummy argument is NULL() with MOLD argument present, or set length
to either 0 or the callee's expected character length.  For assumed-rank
dummies, use the rank of the MOLD argument.  Generate temporaries for
passed arguments when needed.

PR fortran/104819

gcc/fortran/ChangeLog:

* trans-expr.cc (conv_null_actual): Helper function to handle
passing of NULL() to non-optional dummy arguments of non-bind(c)
procedures.
(gfc_conv_procedure_call): Use it for character dummies.

gcc/testsuite/ChangeLog:

* gfortran.dg/null_actual_6.f90: New test.
gcc/fortran/trans-expr.cc
gcc/testsuite/gfortran.dg/null_actual_6.f90 [new file with mode: 0644]
This page took 0.064011 seconds and 5 git commands to generate.