]> gcc.gnu.org Git - gcc.git/commitdiff
PR modula2/114380 Incorrect type specified in an error message
authorGaius Mulley <gaiusmod2@gmail.com>
Mon, 18 Mar 2024 16:40:35 +0000 (16:40 +0000)
committerGaius Mulley <gaiusmod2@gmail.com>
Mon, 18 Mar 2024 16:40:35 +0000 (16:40 +0000)
This patch corrects an error message relating to a variable of
a SET type. The bugfix is not to skip over set types (in
GetLowestType).

gcc/m2/ChangeLog:

PR modula2/114380
* gm2-compiler/SymbolTable.mod (GetLowestType): Do not
skip over a set type, but return sym.

gcc/testsuite/ChangeLog:

PR modula2/114380
* gm2/pim/fail/badset7.mod: New test.

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

index c08de6a97c32944f84ed8cff6f3ead3ba09b3e41..9d572cff19cd40b7d9ea5c375fa6e37e6de3f6f1 100644 (file)
@@ -6154,7 +6154,7 @@ BEGIN
       SubrangeSym         : type := Subrange.Type |
       ArraySym            : type := Array.Type |
       SubscriptSym        : type := Subscript.Type |
-      SetSym              : type := Set.Type |
+      SetSym              : type := Sym |    (* Stop at the set type.  *)
       UnboundedSym        : type := Unbounded.Type |
       UndefinedSym        : type := NulSym |
       DummySym            : type := NulSym
diff --git a/gcc/testsuite/gm2/pim/fail/badset7.mod b/gcc/testsuite/gm2/pim/fail/badset7.mod
new file mode 100644 (file)
index 0000000..5c2499b
--- /dev/null
@@ -0,0 +1,14 @@
+MODULE badset7 ;
+
+FROM SYSTEM IMPORT WORD ;
+
+PROCEDURE func () : WORD ;
+BEGIN
+   RETURN WORD (0)
+END func ;
+
+VAR
+   b: BITSET ;
+BEGIN
+   b := func () - {6..31}
+END badset7.
This page took 0.071746 seconds and 5 git commands to generate.