diff options
author | Gaius Mulley <gaiusmod2@gmail.com> | 2024-02-22 15:02:19 +0000 |
---|---|---|
committer | Gaius Mulley <gaiusmod2@gmail.com> | 2024-02-22 15:02:19 +0000 |
commit | c1667b1ef538e4da10cf83bdf1ae62d7bdd96128 (patch) | |
tree | 54170a7b4a25a3f50d1f18c7a8ab956c0fc0669b /libcpp | |
parent | 92c40297991f51e7fa942f29517bc4398fce33f9 (diff) | |
download | gcc-c1667b1ef538e4da10cf83bdf1ae62d7bdd96128.zip gcc-c1667b1ef538e4da10cf83bdf1ae62d7bdd96128.tar.gz gcc-c1667b1ef538e4da10cf83bdf1ae62d7bdd96128.tar.bz2 |
PR modula2/114055 improve error message when checking the BY constant
The fix marks a constant created during the default BY clause of the
FOR loop as internal. The type checker will always return true if
checking against an internal const.
gcc/m2/ChangeLog:
PR modula2/114055
* gm2-compiler/M2Check.mod (Import): IsConstLitInternal and
IsConstLit.
(isInternal): New procedure function.
(doCheck): Test for isInternal in either operand and early
return true.
* gm2-compiler/M2Quads.mod (PushOne): Rewrite with extra
parameter internal.
(BuildPseudoBy): Add TRUE parameter to PushOne call.
(BuildIncProcedure): Add FALSE parameter to PushOne call.
(BuildDecProcedure): Add FALSE parameter to PushOne call.
* gm2-compiler/M2Range.mod (ForLoopBeginTypeCompatible):
Uncomment code and tidy up error string.
* gm2-compiler/SymbolTable.def (PutConstLitInternal):
New procedure.
(IsConstLitInternal): New procedure function.
* gm2-compiler/SymbolTable.mod (PutConstLitInternal):
New procedure.
(IsConstLitInternal): New procedure function.
(SymConstLit): New field IsInternal.
(CreateConstLit): Initialize IsInternal to FALSE.
gcc/testsuite/ChangeLog:
PR modula2/114055
* gm2/pim/fail/forloopby.mod: New test.
* gm2/pim/pass/forloopby2.mod: New test.
Signed-off-by: Gaius Mulley <gaiusmod2@gmail.com>
Diffstat (limited to 'libcpp')
0 files changed, 0 insertions, 0 deletions