https://gcc.gnu.org/bugzilla/show_bug.cgi?id=112946
--- Comment #8 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:96a9355a3d5b24f010fa6ad0b51bba5cc3f334f1 commit r14-7123-g96a9355a3d5b24f010fa6ad0b51bba5cc3f334f1 Author: Gaius Mulley <gaiusm...@gmail.com> Date: Thu Jan 11 00:53:56 2024 +0000 PR modula2/112946 set expression type checking This patch adds type checking for binary set operators. It also checks the IN operator and improves the := type checking. gcc/m2/ChangeLog: PR modula2/112946 * gm2-compiler/M2GenGCC.mod (IsExpressionCompatible): Import. (ExpressionTypeCompatible): Import. (CodeStatement): Remove op1, op2, op3 parameters from CodeSetOr, CodeSetAnd, CodeSetSymmetricDifference, CodeSetLogicalDifference. (checkArrayElements): Rename op1 to des and op3 to expr. Use despos and exprpos instead of CurrentQuadToken. (checkRecordTypes): Rename op1 to des and op2 to expr. Use virtpos instead of CurrentQuadToken. (checkIncorrectMeta): Ditto. (checkBecomes): Rename op1 to des and op3 to expr. Use virtpos instead of CurrentQuadToken. (NoWalkProcedure): New procedure stub. (CheckBinaryExpressionTypes): New procedure function. (CheckElementSetTypes): New procedure function. (CodeBinarySet): Re-write. (FoldBinarySet): Re-write. (CodeSetOr): Remove parameters op1, op2 and op3. (CodeSetAnd): Ditto. (CodeSetLogicalDifference): Ditto. (CodeSetSymmetricDifference): Ditto. (CodeIfIn): Call CheckBinaryExpressionTypes and CheckElementSetTypes. * gm2-compiler/M2Quads.mod (BuildRotateFunction): Correct parameters to MakeVirtualTok to reflect parameter block passed to Rotate. gcc/testsuite/ChangeLog: PR modula2/112946 * gm2/pim/fail/badbecomes.mod: New test. * gm2/pim/fail/badexpression.mod: New test. * gm2/pim/fail/badexpression2.mod: New test. * gm2/pim/fail/badifin.mod: New test. * gm2/pim/pass/goodifin.mod: New test. Signed-off-by: Gaius Mulley <gaiusm...@gmail.com>