Intel Fortran fails to recognize the PRIVATE attribute of a type-bound procedure in a base type when it is extended.

Intel Fortran fails to recognize the PRIVATE attribute of a type-bound procedure in a base type when it is extended.

Consider the following simple example:

MODULE b

   IMPLICIT NONE

   !.. Private by default
   PRIVATE

   TYPE, ABSTRACT, PUBLIC :: A_t

      !..
      PRIVATE

      !.. Private fields
      INTEGER :: m_A

   CONTAINS

      !.. Private by default
      PRIVATE

      !.. Private methods
      PROCEDURE(IFoo), PASS(This), DEFERRED :: Foo

   END TYPE A_t

   TYPE, EXTENDS(A_t), PUBLIC :: B_t

      !..
      PRIVATE

   CONTAINS

      !.. Private by default
      PRIVATE

      !.. Private methods
      PROCEDURE :: Foo => BFoo

   END TYPE B_t

   !.. Abstract Interface for class methods
   ABSTRACT INTERFACE

      !.. Initialize EosClass
      PURE ELEMENTAL SUBROUTINE IFoo(This)

         IMPORT :: A_t

         !.. Argument list
         CLASS(A_t), INTENT(INOUT) :: This

      END SUBROUTINE IFoo

   END INTERFACE

CONTAINS

   PURE ELEMENTAL SUBROUTINE BFoo(This)

      !.. Argument list
      CLASS(B_t), INTENT(INOUT) :: This

      !..
      This%m_A = 0

      !..
      RETURN

      END SUBROUTINE BFoo

END MODULE b

MODULE c

   USE b, ONLY : B_t

   !..
   IMPLICIT NONE

   !.. Private by default
   PRIVATE

   TYPE, EXTENDS(B_t), PUBLIC :: C_t

      !..
      PRIVATE

      INTEGER :: m_C

   CONTAINS

      !.. Private by default
      PRIVATE

      !.. Private methods
      PROCEDURE, PASS(This), PUBLIC :: Bar

   END TYPE C_t

CONTAINS

   PURE ELEMENTAL SUBROUTINE Bar(This)

      !.. Argument list
      CLASS(C_t), INTENT(INOUT) :: This

      !..
      This%m_C = 0
      CALL This%Foo() ! <-- Foo is PRIVATE to module b; compiler should flag
                      !     an error

      !..
      RETURN

   END SUBROUTINE Bar

END MODULE c

 

Intel Fortran compiler  - version 13 (XE 13.1.1.171) and 2015 Beta - fails to flag an error at line 109 that the invoked method Foo is PRIVATE to MODULE b.  It compiles the code with no errors.

I think this is a compiler bug.  Can someone from Intel please check and do the needful?

Thanks,

 

2 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

Thanks. Escalated as issue DPD200359178.

Steve - Intel Developer Support

Leave a Comment

Please sign in to add a comment. Not a member? Join today