Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.
29285 Discussions

Binding argument CLASS/TYPE mismatch not diagnosed

IanH
Honored Contributor III
505 Views

The following shows that 15.0 fails to diagnose a mismatch in the CLASS/TYPE characteristics of a dummy argument (which isn't the passed argument) for a procedure used to override a binding.

MODULE m
  IMPLICIT NONE
  
  TYPE, ABSTRACT :: Parent
  CONTAINS
    PROCEDURE(parent_Binding), DEFERRED :: Binding
  END TYPE Parent
  
  TYPE :: Thing
  END TYPE Thing
  
  ABSTRACT INTERFACE
    SUBROUTINE parent_Binding(left, right)
      IMPORT Parent
      IMPORT Thing
      IMPLICIT NONE
      CLASS(Parent), INTENT(IN) :: left
      CLASS(Thing), INTENT(IN) :: right       ! <-- Polymorphic!
    END SUBROUTINE parent_Binding
  END INTERFACE
  
  TYPE, EXTENDS(Parent) :: Extension
  CONTAINS
    PROCEDURE :: Binding => extension_Binding
  END TYPE Extension
CONTAINS
  SUBROUTINE extension_Binding(left, right)
    CLASS(Extension), INTENT(IN) :: left
    TYPE(Thing), INTENT(IN) :: right          ! <-- Not polymorphic!
  END SUBROUTINE extension_Binding
END MODULE m

 

>ifort /c /check:all /warn:all /standard-semantics /Od Poly-NotPoly-NotDiagnosed.f90
Intel(R) Visual Fortran Intel(R) 64 Compiler XE for applications running on Intel(R) 64, Version 15.0.0.108 Build 20140726
Copyright (C) 1985-2014 Intel Corporation.  All rights reserved.

Poly-NotPoly-NotDiagnosed.f90(27): remark #7712: This variable has not been used.   [LEFT]
  SUBROUTINE extension_Binding(left, right)
-------------------------------^
Poly-NotPoly-NotDiagnosed.f90(27): remark #7712: This variable has not been used.   

SUBROUTINE extension_Binding(left, right) -------------------------------------^

Perhaps this isn't required for standard conformance, but it would sure be very nice to have, given similar capabilities of the compiler in this area, and how bewildering things get when you get this wrong!

0 Kudos
1 Reply
Steven_L_Intel1
Employee
505 Views

Thanks, we'll look into it

0 Kudos
Reply