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

Compiler erroneously allows a procedure pointer to an elemental procedure.

$
0
0

Consider the following simple example: the compiler (version 14 as well as 2015 BETA) allows a procedure pointer to an elemental procedure and based on what I understand, this is a violation of the standard.  So I request Intel staff to take a look and do the needful; my apologies if this issue has already been identified and a tracking incident is already in effect.

   MODULE m

      !..
      IMPLICIT NONE

      !..
      PRIVATE

      !.. Private fields
      INTEGER :: m_i1 = 1
      PROCEDURE(GetAbstract), POINTER :: Get

      !.. Public methods
      PUBLIC :: Set

      !.. Abstract Interface for a getter method
      ABSTRACT INTERFACE

         PURE ELEMENTAL FUNCTION GetAbstract() RESULT(RetVal)
            !.. Function result
            INTEGER :: RetVal
         END FUNCTION GetAbstract

      END INTERFACE

   CONTAINS

      PURE ELEMENTAL FUNCTION get_i1() RESULT(RetVal)

         !.. Function result
         INTEGER :: RetVal

         !..
         RetVal = m_i1

         !..
         RETURN

      END FUNCTION get_i1

      SUBROUTINE Set(qName)

         !.. Argument list
         CHARACTER(LEN=*), INTENT(IN) :: qName

         !..
         Get => NULL()
         IF (qName == "i1") THEN
            Get => get_i1
         END IF

         !..
         RETURN

      END SUBROUTINE Set

   END MODULE m

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>