aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGaius Mulley <gaiusmod2@gmail.com>2024-03-18 16:40:35 +0000
committerGaius Mulley <gaiusmod2@gmail.com>2024-03-18 16:40:35 +0000
commitd2029bbc69df7341775faf6cf1aa13d978c223a1 (patch)
tree99c23080db4faa7d713c729873083cb99ad12515
parent3e3ad8eeb41b6a6964604bbbb1bb3dee0182bbf9 (diff)
downloadgcc-d2029bbc69df7341775faf6cf1aa13d978c223a1.zip
gcc-d2029bbc69df7341775faf6cf1aa13d978c223a1.tar.gz
gcc-d2029bbc69df7341775faf6cf1aa13d978c223a1.tar.bz2
PR modula2/114380 Incorrect type specified in an error message
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>
-rw-r--r--gcc/m2/gm2-compiler/SymbolTable.mod2
-rw-r--r--gcc/testsuite/gm2/pim/fail/badset7.mod14
2 files changed, 15 insertions, 1 deletions
diff --git a/gcc/m2/gm2-compiler/SymbolTable.mod b/gcc/m2/gm2-compiler/SymbolTable.mod
index c08de6a..9d572cf 100644
--- a/gcc/m2/gm2-compiler/SymbolTable.mod
+++ b/gcc/m2/gm2-compiler/SymbolTable.mod
@@ -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
index 0000000..5c2499b
--- /dev/null
+++ b/gcc/testsuite/gm2/pim/fail/badset7.mod
@@ -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.