https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114380
Bug ID: 114380
Summary: Incorrect type specified in an error message
Product: gcc
Version: 14.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: modula2
Assignee: gaius at gcc dot gnu.org
Reporter: gaius at gcc dot gnu.org
Target Milestone: ---
The source code:
MODULE tiny4 ;
FROM SYSTEM IMPORT WORD ;
PROCEDURE func () : WORD ;
BEGIN
RETURN WORD (0)
END func ;
VAR
b: BITSET ;
BEGIN
b := func () - {6..31}
END tiny4.
when compiled should complain about BITSET rather than CARDINAL.
$ gm2 tiny4.mod
tiny4.mod:13:17: error: In program module 'tiny4': type incompatibility between
'CARDINAL' and 'WORD'
13 | b := func () - {6..31}
| ~~~~~~~~^~~~~~~~~