PGI User Forum
 SearchSearch   MemberlistMemberlist     RegisterRegister   ProfileProfile    Log inLog in 

Free OpenACC Webinar

Severe error when overriding abstract type in Fortran

 
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling
View previous topic :: View next topic  
Author Message
Paul Romano



Joined: 29 Jan 2014
Posts: 3

PostPosted: Thu Mar 13, 2014 5:22 am    Post subject: Severe error when overriding abstract type in Fortran Reply with quote

It appears that when you have an abstract type with a deferred type-bound function that returns a character variable that is of length determined by an input argument, and this deferred function is overridden in an extended type, the PGI compiler fails to compile it and gives a severe error. Here is a small code example:

Code:
module pgi_override_char_param

  type, abstract :: parent
  contains
    procedure(iName), nopass, deferred :: name
  end type parent

  abstract interface
    function iName(n) result(myName)
      integer, intent(in) :: n
      character(len=n) :: myName
    end function iName
  end interface

  type, extends(parent) :: child
  contains
    procedure, nopass :: name
  end type child

contains

  function name(n) result(myName)
    integer, intent(in) :: n
    character(len=n) :: myName
    myName = ' '
  end function name

end module


When I try to compile this with pgf90 version 14.3, I get the following error:
Code:
PGF90-S-0155-Result is not compatible with parent's result for type bound procedure name (pgi_override_char_param.f90: 28)
PGF90/x86-64 Linux 14.3-0: compilation completed with severe errors


This code successfully compiles using Intel Fortran as well as gfortran 4.8.2.
Back to top
View user's profile
mkcolg



Joined: 30 Jun 2004
Posts: 6215
Location: The Portland Group Inc.

PostPosted: Thu Mar 13, 2014 1:00 pm    Post subject: Reply with quote

Hi Paul,

Thanks for the report. I've reproduce the error here and sent it on to engineering for further investigation (TPR#19996)

Best Regards,
Mat
Back to top
View user's profile
jtull



Joined: 30 Jun 2004
Posts: 445

PostPosted: Fri May 02, 2014 11:40 am    Post subject: TPR 19996 - Severe err- overriding abstract type in Fortran Reply with quote

This problem has been fixed in the current 14.4 release.

Thanks,
dave
Back to top
View user's profile
Display posts from previous:   
Post new topic   Reply to topic    PGI User Forum Forum Index -> Programming and Compiling All times are GMT - 7 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © phpBB Group