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

--- Comment #9 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Gaius Mulley <ga...@gcc.gnu.org>:

https://gcc.gnu.org/g:f9a48fe7032d9894e88d0d121ba6f75b08ea5dcb

commit r14-10053-gf9a48fe7032d9894e88d0d121ba6f75b08ea5dcb
Author: Gaius Mulley <gaiusm...@gmail.com>
Date:   Sat Apr 20 14:35:18 2024 +0100

    PR modula2/112893 full type checking between proctype and procedure not
implemented

    This patch implements full type checking between proctype and procedures.
    The change implements an associated proc type built for each
    procedure.  M2Check.mod will request GetProcedureProcType if it encounters
    a procedure.  Before this patch a procedure was associated with the type
    ADDRESS in the type checking module M2Check.  The
    gm2/pim/pass/proccard.mod have been corrected now this assumption has
    been removed.

    gcc/m2/ChangeLog:

            PR modula2/112893
            * gm2-compiler/M2Check.mod (GetProcedureProcType): Import.
            (getType): Return value using GetProcedureProcType if sym is a
            procedure.
            * gm2-compiler/M2Range.mod (FoldTypeExpr): Remove quad if
            expression is type compatible.
            * gm2-compiler/SymbolTable.def (GetProcedureProcType): New
            procedure function.
            * gm2-compiler/SymbolTable.mod (Procedure): Add ProcedureType.
            (MakeProcedure): Initialize ProcedureType.
            (PutParam): Call AddProcedureProcTypeParam.
            (PutVarParam): Call AddProcedureProcTypeParam.
            (AddProcedureProcTypeParam): New procedure.
            (GetProcedureProcType): New procedure function.

    gcc/testsuite/ChangeLog:

            PR modula2/112893
            * gm2/pim/pass/another.mod: Correct bug exposed by type checker.
            Swap ProcA and ProcB assignments.
            * gm2/pim/pass/proccard.mod: Use VAL to convert procedure into a
            cardinal.
            * gm2/iso/const/fail/castproctype.mod: New test.
            * gm2/pim/fail/badproctype.mod: New test.

    Signed-off-by: Gaius Mulley <gaiusm...@gmail.com>

Reply via email to