https://gcc.gnu.org/bugzilla/show_bug.cgi?id=118453
--- Comment #2 from Gaius Mulley <gaius at gcc dot gnu.org> --- Created attachment 60136 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=60136&action=edit Proposed fix Here is a proposed fix which uses virtual tokens during the construction of subrange types. After the patch is applied the error messages issued are: $ gm2 badparamset1.mod badparamset1.mod:15:9: error: 1st parameter failure due to assignment incompatibility between actual parameter ‘m’ and the 1st formal ‘d’ parameter in procedure ‘foo’ 15 | foo (m) | ^ badparamset1.mod:4:19: error: actual parameter subrange 4 | month = SET OF [1..12] ; | ^~~~~~~ badparamset1.mod:5:17: error: formal parameter subrange 5 | day = SET OF [1..31] ; | ^~~~~~~