https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95038
--- Comment #1 from Bill Long <longb at cray dot com> --- Note that for the greatly simplified test case > cat test3.f90 real(4) function x (a) real(kind(x)) a(:) print *, kind(x) end function x gfortran compiles with no error. So maybe the issue boils down to the selection of the error message in the original test case.