From: Gaius Mulley Date: Mon, 18 Mar 2024 16:40:35 +0000 (+0000) Subject: PR modula2/114380 Incorrect type specified in an error message X-Git-Tag: basepoints/gcc-15~619 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d2029bbc69df7341775faf6cf1aa13d978c223a1;p=thirdparty%2Fgcc.git 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 --- diff --git a/gcc/m2/gm2-compiler/SymbolTable.mod b/gcc/m2/gm2-compiler/SymbolTable.mod index c08de6a97c32..9d572cff19cd 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 000000000000..5c2499be7391 --- /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.