]> git.ipfire.org Git - thirdparty/gcc.git/commit
[PATCH] PR modula2/119914 No error message generated when passing a Ztype to an unbou...
authorGaius Mulley <gaiusmod2@gmail.com>
Tue, 13 May 2025 16:51:22 +0000 (17:51 +0100)
committerGaius Mulley <gaiusmod2@gmail.com>
Tue, 13 May 2025 16:51:22 +0000 (17:51 +0100)
commitb8032bec831a4a48636e7ffd771e76efc1ff27ea
treed94cd9c42417e43a865849f8ca64aa1cdd3d360a
parentc220b8e7b422ed04b6aaa1b9243b550df913f476
[PATCH] PR modula2/119914 No error message generated when passing a Ztype to an unbounded array

This patch detects constants ZType, RType, CType being passed to unbounded
arrays and generates an error message highlighting the formal and
actual parameters in error.

gcc/m2/ChangeLog:

PR modula2/119914
* gm2-compiler/M2Check.mod (checkConstMeta): Add check for
Ztype, Rtype and Ctype and unbounded arrays.
(IsZRCType): New procedure function.
(isZRC): Add comment.
* gm2-compiler/M2Quads.mod:
* gm2-compiler/M2Range.mod (gdbinit): New procedure.
(BreakWhenRangeCreated): Ditto.
(CheckBreak): Ditto.
(InitRange): Call CheckBreak.
(Init): Add gdbhook and initialize interactive watch point.
* gm2-compiler/SymbolTable.def (GetNthParamAnyClosest): New
procedure function.
* gm2-compiler/SymbolTable.mod (BreakSym): Remove constant.
(BreakSym): Add Variable.
(stop): Remove.
(gdbhook): New procedure.
(BreakWhenSymCreated): Ditto.
(CheckBreak): Ditto.
(NewSym): Call CheckBreak.
(Init): Add gdbhook and initialize interactive watch point.
(MakeProcedure): Replace guarded call to stop with CheckBreak.
(GetNthParamChoice): New procedure function.
(GetNthParamOrdered): Ditto.
(GetNthParamAnyClosest): Ditto.
(GetOuterModuleScope): Ditto.

gcc/testsuite/ChangeLog:

PR modula2/119914
* gm2/pim/fail/constintarraybyte.mod: New test.

(cherry picked from commit e9a81addd5b7d018e173fa8d59aafc2f84e41d8b)

Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
gcc/m2/gm2-compiler/M2Check.mod
gcc/m2/gm2-compiler/M2Quads.mod
gcc/m2/gm2-compiler/M2Range.mod
gcc/m2/gm2-compiler/SymbolTable.def
gcc/m2/gm2-compiler/SymbolTable.mod
gcc/testsuite/gm2/pim/fail/constintarraybyte.mod [new file with mode: 0644]