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

--- Comment #1 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:04799f03e8d01b903295ef3a100a0117b7ddbf5e

commit r14-9709-g04799f03e8d01b903295ef3a100a0117b7ddbf5e
Author: Gaius Mulley <(no_default)>
Date:   Thu Mar 28 14:57:49 2024 +0000

    PR modula2/114517 gm2 does not allow comparison operator hash in column one

    This patch allows -fno-cpp to be supplied to gm2.  Without this patch
    it causes an ICE.  The patch allows -fno-cpp to turn off cpp flags.
    These are tested in m2.flex to decide whether a change of state is
    allowed (enabling handling of #line directives).

    gcc/ChangeLog:

            PR modula2/114517
            * doc/gm2.texi: Mention gm2 treats a # in the first column
            as a preprocessor directive unless -fno-cpp is supplied.

    gcc/m2/ChangeLog:

            PR modula2/114517
            * gm2-compiler/M2Options.def (SetCpp): Add comment.
            (GetCpp): Move after SetCpp.
            (GetLineDirectives): New procedure function.
            * gm2-compiler/M2Options.mod (GetLineDirectives): New
            procedure function.
            * gm2-gcc/m2options.h (M2Options_GetLineDirectives): New
            prototype.
            * gm2-lang.cc (gm2_langhook_init_options): OPT_fcpp only
            assert if !value.
            * m2.flex: Test GetLineDirectives before changing to LINE0
            state.

    gcc/testsuite/ChangeLog:

            PR modula2/114517
            * gm2/cpp/fail/hashfirstcolumn2.mod: New test.
            * gm2/imports/fail/imports-fail.exp: New test.
            * gm2/imports/fail/localmodule2.mod: New test.
            * gm2/imports/run/pass/localmodule.mod: New test.

    Signed-off-by: Gaius Mulley <(no_default)>

Reply via email to