https://gcc.gnu.org/bugzilla/show_bug.cgi?id=104630
--- Comment #4 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:9fc5a7a25e9e29f58359c6363c9b10a99c6f99f0 commit r17-1158-g9fc5a7a25e9e29f58359c6363c9b10a99c6f99f0 Author: Paul Thomas <[email protected]> Date: Mon Jun 1 12:40:53 2026 +0100 Fortran: Fix submodule access to private symbols in parent module [PR88632,104630] PRs 88632 and 104630 both suffered link a problem, where a private procedure in a parent module was not visible in a descendent submodule if they were compiled separately. The fix is to not filter out private symbols when writing the .smod file. Submodules are descendants of their ancestor module and access private symbols in the module's contains section via host association (F2018 14.2.2). The testcase here is that of PR104630. However, it is functionally identical to that of PR88632. 2026-06-02 Paul Thomas <[email protected]> gcc/fortran PR fortran/88632 PR fortran/104630 * module.cc (write_symtree): Do not filter out private symbols when writing a submodule interface file (.smod). Submodules are descendants of their ancestor module and access private symbols in the module's contains section via host association per Fortran 2018 section 14.2.2. gcc/testsuite/ PR fortran/88632 PR fortran/104630 * gfortran.dg/submodule_35.f90: New test. * gfortran.dg/submodule_35_aux.f90: Submodule and program for for the new test. Assisted by: Claude Sonnet 4.6
