The following code compiles with no errors or warnings with the latest Intel Fortran compiler 2015, update 2 even with -stand compiler option:
pure subroutine foo(val)
class(*), allocatable, intent(out) :: val
allocate(val, source=0.0)
end subroutine foo
but gfortran (GCC 5 development truck) throws an error:
pure subroutine foo(val)
1
Error: INTENT(OUT) argument 'val' of pure procedure 'foo' at (1) may not be polymorphic
I fail to see anything in the standard about INTENT(OUT) and polymorphic dummy arguments and pure procedures. Is gfortran misinterpreting the standard or is Intel Fortran incorrect to allow this?
Thanks,