Bug 37427 - Passed-object dummy argument should be polymorphic
Summary: Passed-object dummy argument should be polymorphic
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: fortran (show other bugs)
Version: unknown
: P4 minor
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: accepts-invalid
Depends on:
Blocks:
 
Reported: 2008-09-08 15:12 UTC by Daniel Kraft
Modified: 2009-10-07 14:04 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2008-09-08 15:12:50


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Daniel Kraft 2008-09-08 15:12:45 UTC
As polymorphic entities are not implemented in gfortran, the handling of passed-object dummy arguments allows (or requires) them to be declared non-polymorphic (TYPE(t)) while they should in fact be CLASS(t):

MODULE m

  TYPE :: t
  CONTAINS
    PROCEDURE :: proc
  END TYPE t

CONTAINS

  SUBROUTINE proc (me)
    TYPE(t) :: me ! should be CLASS(t) :: me
  END SUBROUTINE proc

END MODULE m
Comment 1 Daniel Kraft 2009-08-10 10:57:47 UTC
After Janus' recent check-in of CLASS parsing, this behaviour is fixed (though CLASS is not really polymorphic).

I'm not sure if we should close this or keep open until CLASS is fully implemented.  Janus, feel free to close it if you think that's ok.
Comment 2 Daniel Kraft 2009-10-07 14:04:58 UTC
At least now this can be considered fully implemented, I think.