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

--- Comment #6 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-16 branch has been updated by Gaius Mulley
<[email protected]>:

https://gcc.gnu.org/g:0e7047f939dd756a49873afdce9bc01f6bc57453

commit r16-9954-g0e7047f939dd756a49873afdce9bc01f6bc57453
Author: Gaius Mulley <[email protected]>
Date:   Fri Nov 13 09:52:49 2026 +0000

    PR modula2/127567: Import in local module cannot import an external module

    This patch allows a local import to import an external library
    module providing it was imported by the main module.  See
    tinygoodimport.mod for clarity.

    gcc/m2/ChangeLog:

            PR modula2/127567
            * gm2-compiler/P1SymBuild.mod (BuildImportInnerModule): Call
            PutImported if sym is a defimp or module.
            * gm2-compiler/SymbolConversion.def (Gcc2Mod): Correct parameter
            name.
            * gm2-compiler/SymbolConversion.mod (Gcc2Mod): Ditto.
            * gm2-compiler/SymbolTable.mod (IsExternalModule): New procedure
            function.
            (AddSymToModuleScope): Only generate an error if the symbol is
            not an external module.

    gcc/testsuite/ChangeLog:

            PR modula2/127567
            * gm2/imports/fail/tinybadimport.mod: New test.
            * gm2/imports/run/pass/tinygoodimport.mod: New test.

    (cherry picked from commit 2ce11ed2a2f4eeae68a5cb059307be8153448d8d)

    Signed-off-by: Gaius Mulley <[email protected]>

Reply via email to