https://gcc.gnu.org/bugzilla/show_bug.cgi?id=127657
--- Comment #2 from Gaius Mulley <gaius at gcc dot gnu.org> --- Created attachment 65719 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=65719&action=edit Proposed fix which adds context filtering to VAL $ gm2 valspell.mod valspell.mod:14:14: error: In program module ‘valspell’: undeclared type found in builtin procedure function VAL ‘CARDIN’, did you mean CARDINAL? 14 | c := VAL (CARDIN, i) | ^~~~~~ $ cat valspell2.mod (* { dg-do compile } *) (* { dg-options "-g -c" } *) MODULE valspell2 ; TYPE i1 = CHAR ; VAR c: CARDINAL ; i9: INTEGER ; BEGIN i9 := 1 ; c := VAL (CARDINAL, ii) (* { dg-error "undeclared variable or constant expression found in builtin procedure function VAL 'ii', did you mean i9" "ii" { target *-*-* } 14 } *) END valspell2. $ gm2 valspell2.mod valspell2.mod:14:24: error: In program module ‘valspell2’: undeclared variable or constant expression found in builtin procedure function VAL ‘ii’, did you mean i9? 14 | c := VAL (CARDINAL, ii) | ^~
