<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Checking of overriding function result characteristics in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Checking-of-overriding-function-result-characteristics/m-p/811414#M42887</link>
    <description>&lt;P&gt;A feature request - I appreciate there's no constraint, but 12.0.2 and earlier will complain if an overriding procedure doesn't have a argument list that appropriately matches the overridden procedure, which is nice. Could we please have that check extended to function results as well?&lt;BR /&gt;&lt;BR /&gt;[fortran]MODULE A_mod IMPLICIT NONE PRIVATE TYPE, PUBLIC :: A_type CONTAINS PROCEDURE, NOPASS :: Sub =&amp;gt; a_Sub PROCEDURE, NOPASS :: Fun =&amp;gt; a_Fun END TYPE A_type CONTAINS SUBROUTINE a_Sub(i, r) INTEGER, INTENT(IN) :: i INTEGER, INTENT(OUT) :: r !**** r = i + 1 END SUBROUTINE a_Sub FUNCTION a_Fun(i) RESULT INTEGER, INTENT(IN) :: i INTEGER :: r !**** r = i + 1 END FUNCTION a_Fun END MODULE A_mod MODULE B_mod USE A_mod IMPLICIT NONE PRIVATE TYPE, EXTENDS(A_type), PUBLIC :: B_type CONTAINS PROCEDURE, NOPASS :: Sub =&amp;gt; b_Sub PROCEDURE, NOPASS :: Fun =&amp;gt; b_Fun END TYPE B_type CONTAINS SUBROUTINE b_Sub(i, r) INTEGER, INTENT(IN) :: i INTEGER, INTENT(OUT) :: r !REAL, INTENT(OUT) :: r ! This would cause error #8383 !**** r = i + 2.0 END SUBROUTINE b_Sub FUNCTION b_Fun(i) RESULT INTEGER, INTENT(IN) :: i REAL :: r ! Oops! Silly programmer... !**** r = i + 2.0 END FUNCTION b_Fun END MODULE B_mod PROGRAM fun_intf_matching_not USE A_mod USE B_mod IMPLICIT NONE TYPE(B_type) :: not_poly_var CLASS(A_type), ALLOCATABLE :: poly_var !**** PRINT *, not_poly_var%Fun(1) ! "3.0" - all good - my maths is ok. ALLOCATE(B_type :: poly_var) PRINT *, poly_var%Fun(1) ! "1" - uh oh... back to school for me!? END PROGRAM fun_intf_matching_not [/fortran]&lt;/P&gt;</description>
    <pubDate>Tue, 01 Feb 2011 04:26:14 GMT</pubDate>
    <dc:creator>IanH</dc:creator>
    <dc:date>2011-02-01T04:26:14Z</dc:date>
    <item>
      <title>Checking of overriding function result characteristics</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Checking-of-overriding-function-result-characteristics/m-p/811414#M42887</link>
      <description>&lt;P&gt;A feature request - I appreciate there's no constraint, but 12.0.2 and earlier will complain if an overriding procedure doesn't have a argument list that appropriately matches the overridden procedure, which is nice. Could we please have that check extended to function results as well?&lt;BR /&gt;&lt;BR /&gt;[fortran]MODULE A_mod IMPLICIT NONE PRIVATE TYPE, PUBLIC :: A_type CONTAINS PROCEDURE, NOPASS :: Sub =&amp;gt; a_Sub PROCEDURE, NOPASS :: Fun =&amp;gt; a_Fun END TYPE A_type CONTAINS SUBROUTINE a_Sub(i, r) INTEGER, INTENT(IN) :: i INTEGER, INTENT(OUT) :: r !**** r = i + 1 END SUBROUTINE a_Sub FUNCTION a_Fun(i) RESULT INTEGER, INTENT(IN) :: i INTEGER :: r !**** r = i + 1 END FUNCTION a_Fun END MODULE A_mod MODULE B_mod USE A_mod IMPLICIT NONE PRIVATE TYPE, EXTENDS(A_type), PUBLIC :: B_type CONTAINS PROCEDURE, NOPASS :: Sub =&amp;gt; b_Sub PROCEDURE, NOPASS :: Fun =&amp;gt; b_Fun END TYPE B_type CONTAINS SUBROUTINE b_Sub(i, r) INTEGER, INTENT(IN) :: i INTEGER, INTENT(OUT) :: r !REAL, INTENT(OUT) :: r ! This would cause error #8383 !**** r = i + 2.0 END SUBROUTINE b_Sub FUNCTION b_Fun(i) RESULT INTEGER, INTENT(IN) :: i REAL :: r ! Oops! Silly programmer... !**** r = i + 2.0 END FUNCTION b_Fun END MODULE B_mod PROGRAM fun_intf_matching_not USE A_mod USE B_mod IMPLICIT NONE TYPE(B_type) :: not_poly_var CLASS(A_type), ALLOCATABLE :: poly_var !**** PRINT *, not_poly_var%Fun(1) ! "3.0" - all good - my maths is ok. ALLOCATE(B_type :: poly_var) PRINT *, poly_var%Fun(1) ! "1" - uh oh... back to school for me!? END PROGRAM fun_intf_matching_not [/fortran]&lt;/P&gt;</description>
      <pubDate>Tue, 01 Feb 2011 04:26:14 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Checking-of-overriding-function-result-characteristics/m-p/811414#M42887</guid>
      <dc:creator>IanH</dc:creator>
      <dc:date>2011-02-01T04:26:14Z</dc:date>
    </item>
    <item>
      <title>Checking of overriding function result characteristics</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Checking-of-overriding-function-result-characteristics/m-p/811415#M42888</link>
      <description>Ian,&lt;BR /&gt;&lt;BR /&gt;Thanks for the feature request. I have submitted it to engineering with tracking number: DPD200165615. Not sure you are familiar with our Static Security Analysis available by purchasing Intel Parallel Studio XE? It uses the Inspector product to find coding errors like this (although I have not tested it on this particular error). More info here:&lt;BR /&gt;&lt;BR /&gt;&lt;A href="http://software.intel.com/en-us/articles/intel-parallel-studio-xe/" target="_blank"&gt;http://software.intel.com/en-us/articles/intel-parallel-studio-xe/&lt;/A&gt;&lt;BR /&gt;&lt;P&gt;------&lt;/P&gt;&lt;P&gt;Wendy&lt;/P&gt;&lt;P&gt;&lt;A href="http://software.intel.com/en-us/forums/intel-visual-fortran-compiler-for-windows/announcement/241/"&gt;Attaching or including files in a post&lt;/A&gt;&lt;/P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 01 Feb 2011 18:40:25 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Checking-of-overriding-function-result-characteristics/m-p/811415#M42888</guid>
      <dc:creator>Wendy_Doerner__Intel</dc:creator>
      <dc:date>2011-02-01T18:40:25Z</dc:date>
    </item>
    <item>
      <title>Checking of overriding function result characteristics</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Checking-of-overriding-function-result-characteristics/m-p/811416#M42889</link>
      <description>Oops. I fibbed a bit... there are some gaps in the subroutine argument checking too, which have had me chasing my tail for the last week or so. Again, I guess this falls into the feature request category.&lt;BR /&gt;&lt;BR /&gt;&lt;PRE&gt;[fortran]MODULE BarParentMod
  IMPLICIT NONE 
  PRIVATE
  
  TYPE, PUBLIC :: Foo
  END TYPE Foo
  
  TYPE, PUBLIC, ABSTRACT :: BarParent
  CONTAINS
    PROCEDURE(intf_without_allocatable_arg), DEFERRED :: Proc    
  END TYPE BarParent
  
  ABSTRACT INTERFACE
    SUBROUTINE intf_without_allocatable_arg(obj, arg, dt)
      IMPORT :: BarParent, Foo
      IMPLICIT NONE
      CLASS(BarParent), INTENT(IN) :: obj
      REAL, INTENT(OUT) :: arg   ! Oops!  Should be allocatable.
      CLASS(Foo), INTENT(OUT) :: dt
    END SUBROUTINE intf_without_allocatable_arg
  END INTERFACE 
END MODULE BarParentMod

MODULE BarMod
  USE BarParentMod
  IMPLICIT NONE
  PRIVATE
  
  TYPE, PUBLIC, EXTENDS(BarParent) :: Bar
  CONTAINS
    PROCEDURE :: Proc =&amp;gt; proc_with_allocatable_arg
  END TYPE Bar 
CONTAINS
  SUBROUTINE proc_with_allocatable_arg(obj, arg, dt)
    CLASS(Bar), INTENT(IN) :: obj
    REAL, INTENT(OUT), ALLOCATABLE :: arg
    TYPE(Foo), INTENT(OUT) :: dt  ! Oops! - I'm not very classy.
    !****
    ALLOCATE(arg)
    arg = 1.0
  END SUBROUTINE proc_with_allocatable_arg
END MODULE BarMod

PROGRAM NoCheckOfAllocatableOrPolymorphic
  USE BarParentMod
  USE BarMod
  IMPLICIT NONE
  CLASS(BarParent), ALLOCATABLE :: obj
  REAL :: arg
  TYPE(Foo) :: dt
  !****
  ALLOCATE(Bar:: obj)
  CALL obj%Proc(arg, dt)
END PROGRAM NoCheckOfAllocatableOrPolymorphic
[/fortran]&lt;/PRE&gt;</description>
      <pubDate>Mon, 04 Apr 2011 02:27:46 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Checking-of-overriding-function-result-characteristics/m-p/811416#M42889</guid>
      <dc:creator>IanH</dc:creator>
      <dc:date>2011-04-04T02:27:46Z</dc:date>
    </item>
    <item>
      <title>Checking of overriding function result characteristics</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Checking-of-overriding-function-result-characteristics/m-p/811417#M42890</link>
      <description>Thanks for the additional test case which I have added to the one engineering is already looking into. By the way your first was deemed a compiler bug, not a feature request. Will update this thread when we have a compiler that resolves it.&lt;BR /&gt;&lt;BR /&gt;&lt;P&gt;------&lt;/P&gt;&lt;P&gt;Wendy&lt;/P&gt;&lt;P&gt;&lt;A href="http://software.intel.com/en-us/forums/intel-visual-fortran-compiler-for-windows/announcement/241/"&gt;Attaching or including files in a post&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Apr 2011 21:36:41 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Checking-of-overriding-function-result-characteristics/m-p/811417#M42890</guid>
      <dc:creator>Wendy_Doerner__Intel</dc:creator>
      <dc:date>2011-04-04T21:36:41Z</dc:date>
    </item>
    <item>
      <title>With the 13.0 compiler we now</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Checking-of-overriding-function-result-characteristics/m-p/811418#M42891</link>
      <description>With the 13.0 compiler we now give errors on this test case, in other words check the functions as we should.

Wendy Doerner
Intel Developer Support</description>
      <pubDate>Mon, 08 Oct 2012 22:01:50 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Checking-of-overriding-function-result-characteristics/m-p/811418#M42891</guid>
      <dc:creator>Wendy_Doerner__Intel</dc:creator>
      <dc:date>2012-10-08T22:01:50Z</dc:date>
    </item>
  </channel>
</rss>

