This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch, Fortran, Doc] Document type-bound operators


On 08/28/2009 12:04 PM, Paul Richard Thomas wrote:
> Also, according to 4.5.3:
> C453 The passed-object dummy argument shall be a scalar, nonpointer,
> nonallocatable dummy data object with the same declared type as the
> type being defined; all of its length type parameters shall be
> assumed; it shall be polymorphic (5.1.1.2) if and only if the type
> being defined is extensible (4.5.6).
>
> This last is not true of gfortran as of 20090812; ie. if a
> non-extensible declared type is PASSED and the dummy is of that type,
> gfortran complains that it is not polymorphic.
>   
I am pretty sure it works - as the following example shows:

module m
type :: t
  SEQUENCE
  procedure(foo), pointer :: ptr
end type
contains
  subroutine foo(a)
    type(t) :: a  ! valid and no error is shown
  end subroutine foo
end module m

Note: BIND(C) is also not-extensible but there procedure pointer
components are not allowed. And type-bound procedures are only allowed
in non-sequence/non-bind(C) types, which are by definition extensible.

Tobias


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]