Quantcast
Channel: Intel® Fortran Compiler
Viewing all articles
Browse latest Browse all 3270

A problem with CLASS(*), POINTER and ASSOCIATE

$
0
0

Using compiler 15, update 3, I would expect the following simple code should generate a compiler error with the use of an associate-name x without select-type construct; note x is associated with an unlimited polymorphic pointer.  Instead, no compiler errors and warnings are generated.  At run-time, no exception occurs but nothing is printed for x for the statement on line 10.

program p

   implicit none

   class(*), pointer :: ptr

   allocate( ptr, source=1 )

   asc: associate ( x => ptr )
      print *, " x = ", x
   end associate asc

   deallocate(ptr)

   stop

end program p

 


Viewing all articles
Browse latest Browse all 3270

Trending Articles



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