Consider the following code
type A (p, r)
integer, kind :: p, r
real (selected_real_kind(p, r)) :: data
end type
type(a(6,23)) :: a1
print*, a1%data%kind
end
Flang failed at the compile time with
error: Semantic errors in t.f
./t.f:3:15: error: Must be a constant value
real (selected_real_kind(p, r)) :: data
^^^^^^^^^^^^^^^^^^^^^^^^
All ifort, gfortran and XLF compile and execute the code successfully.
The folding of selected_real_kind could occur when the type is instantiated.