Quantcast
Channel: Intel® Software - Intel® Fortran Compiler for Linux* and macOS*
Viewing all articles
Browse latest Browse all 2746

Can the dummy argument of a PURE subroutine with INTENT(OUT) attribute be unlimited polymorphic?

$
0
0

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,

 


Viewing all articles
Browse latest Browse all 2746

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>