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

--- Comment #5 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:f8c8aebc597611b8d37edce165a891d00e23a9c1

commit r14-6271-gf8c8aebc597611b8d37edce165a891d00e23a9c1
Author: Gaius Mulley <gaiusm...@gmail.com>
Date:   Thu Dec 7 13:10:49 2023 +0000

    PR modula2/112893 detect procedure address incompatible with cardinal in
iso

    In ISO m2 the type cardinal is assignment incompatible with address (but
    it is allowed in PIM).  The patch also extends the type checker to include
    procedures (which appear as having GetType () = address).  At some point
    this should be be improved to use a pointer to proc type.  Perhaps in
    the next stage1.
    For now this will catch procedures being passed as actual parameters into
    a formal cardinal parameter in ISO m2 (for example).

    gcc/m2/ChangeLog:

            PR modula2/112893
            * gm2-compiler/M2Base.mod (Ass): Extend array to include proc row
            and column.  Allow PIM to assign cardinal variables to address
            variables.
            (Expr): Ditto.
            (Comp): Ditto.
            * gm2-compiler/M2Check.mod (getSType): New procedure function.
            Replace all occurances of GetSType with getSType.
            * gm2-compiler/M2GenGCC.mod (CodeParam): Rewrite format specifier
            error message.
            * gm2-compiler/M2Quads.mod (CheckProcTypeAndProcedure): Add tokno
            parameter.
            * gm2-compiler/M2Range.def (InitTypesParameterCheck): Add tokno
            parameter.
            (InitParameterRangeCheck): Add tokno parameter.
            Remove EXPORT QUALIFIED list.
            (InitParameterRangeCheck): Add tokno parameter.
            * gm2-compiler/M2Range.mod (InitTypesParameterCheck): Add tokno
            parameter and pass tokno to PutRangeParam.
            (InitParameterRangeCheck): Add tokno parameter and pass tokno to
            PutRangeParam.
            (PutRangeParam): Add tokno parameter and assign to tokenNo.
            (FoldTypeParam): Rewrite format string.

    gcc/testsuite/ChangeLog:

            PR modula2/112893
            * gm2/iso/fail/proccard.mod: New test.
            * gm2/pim/pass/proccard.mod: New test.

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

Reply via email to