https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118080

--- Comment #7 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-14 branch has been updated by Harald Anlauf
<anl...@gcc.gnu.org>:

https://gcc.gnu.org/g:02eedd2932e4c91f41437f56c34eee1a128c24fb

commit r14-11324-g02eedd2932e4c91f41437f56c34eee1a128c24fb
Author: Harald Anlauf <anl...@gmx.de>
Date:   Sat Feb 15 20:36:15 2025 +0100

    Fortran: passing of derived type to VALUE,OPTIONAL dummy argument
[PR118080]

    For scalar OPTIONAL dummy arguments with the VALUE attribute, gfortran
    passes a hidden flag to denote presence or absence of the actual argument
    for intrinsic types.  Extend this treatment to derived type (user-defined
    as well as from intrinsic module ISO_C_BINDING).

            PR fortran/118080

    gcc/fortran/ChangeLog:

            * gfortran.texi: Adjust documentation.
            * trans-decl.cc (create_function_arglist): Adjust to pass hidden
            presence flag also for derived type dummies with VALUE,OPTIONAL
            attribute.
            * trans-expr.cc (gfc_conv_expr_present): Expect hidden presence
            flag also for derived type dummies with VALUE,OPTIONAL attribute.
            (conv_cond_temp): Adjust to allow derived types.
            (conv_dummy_value): Extend to handle derived type dummies with
            VALUE,OPTIONAL attribute.
            (gfc_conv_procedure_call): Adjust for actual arguments passed to
            derived type dummies with VALUE,OPTIONAL attribute.
            * trans-types.cc (gfc_get_function_type): Adjust fndecl for
            hidden presence flag.

    gcc/testsuite/ChangeLog:

            * gfortran.dg/value_optional_2.f90: New test.

    (cherry picked from commit 8859dce9037bcb242819305f02e16edbea38923c)

Reply via email to