I looks like we do give a warning, but not an error. Though it does seem to cause the back-end compiler to hang. I’ve added TPR #33158 and will have engineering take a look.
FYI, the same code causes gfortran 12.2 to segv, though ifort gives the correct error message.