[Bug fortran/125383] [14/15/16/17 Regression] Optional dummy procedure called from contained subprogram results in linking error since r16-3178 / r14-12039

"cvs-commit at gcc dot gnu.org via Gcc-bugs" <[email protected]>
Newsgroups gmane.comp.gcc.bugs
Message-ID <[email protected]/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=125383

--- Comment #12 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Paul Thomas <[email protected]>:

https://gcc.gnu.org/g:1f5c34702948eb7591fa3076be3745bd0e0ddf9c

commit r17-3149-g1f5c34702948eb7591fa3076be3745bd0e0ddf9c
Author: Christopher Albert <[email protected]>
Date:   Thu Jul 30 05:06:45 2026 +0200

    fortran: Preserve host association for dummy procedures [PR125383]

    A call statement marks an unresolved procedure as a subroutine before
    its procedure kind is known.  was_declared treated that provisional
    attribute as a declaration, so resolution did not find an optional
    dummy procedure in the host scope.  Require a known procedure kind
    before the subroutine attribute counts as a declaration.

    Fixes #24

    Assisted-by: GPT-5.6-sol (OpenAI)

            PR fortran/125383

    gcc/fortran/ChangeLog:

            * resolve.cc (was_declared): Require a known procedure kind for
            subroutine declarations.

    gcc/testsuite/ChangeLog:

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

    Signed-off-by: Christopher Albert <[email protected]>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.