Infinite compile time with DT with bad character component

the following code seems to make nvfortran loop infinitely:

module m
  implicit none
  type t
     character(char(1)) :: a  ! erroneous (non-integer) length
  end type
  type(t) :: z = t('a')

This is invalid Fortran and should probably be rejected right away.


Thanks Harold.

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.