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

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

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

commit r15-9985-gb355c295cabcbbf545c1bd5906c7bdb7039fa884
Author: Gaius Mulley <gaiusm...@gmail.com>
Date:   Wed Jul 16 21:17:51 2025 +0100

    [PATCH] PR modula2/120497: error is generated for good code when returning
a pointer var variable

    The return type checking needs to skip over the Lvalue part of the VAR
    parameter or variable.

    gcc/m2/ChangeLog:

            PR modula2/120497
            * gm2-compiler/M2Range.mod (IsAssignmentCompatible): Remove from
            import list.
            (FoldTypeReturnFunc): Rewrite to skip the Lvalue of a var
            variable.
            (CodeTypeReturnFunc): Ditto.
            (CodeTypeIndrX): Call AssignmentTypeCompatible rather than
            IsAssignmentCompatible.
            (FoldTypeIndrX): Ditto.

    gcc/testsuite/ChangeLog:

            PR modula2/120497
            * gm2/pim/pass/ReturnType.mod: New test.
            * gm2/pim/pass/ReturnType2.mod: New test.

    (cherry picked from commit 170717fa243ef466a99498113167627539af4553)

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

Reply via email to