This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [Patch, Fortran, Doc] Document type-bound operators
- From: Tobias Burnus <burnus at net-b dot de>
- To: Paul Richard Thomas <paul dot richard dot thomas at gmail dot com>
- Cc: Daniel Kraft <d at domob dot eu>, Fortran List <fortran at gcc dot gnu dot org>, gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 28 Aug 2009 12:23:15 +0200
- Subject: Re: [Patch, Fortran, Doc] Document type-bound operators
- References: <4A9795B0.6000102@domob.eu> <339c37f20908280304o7a5a8e0x4c88ca6297aec160@mail.gmail.com>
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