On Jul 24, 10:50 am, Tobias Burnus <bur...@[EMAIL PROTECTED]
> wrote:
> Hello,
>
> Assume the following Fortran 2003 source:
>
> MODULE M
> TYPE MOD_T
> INTEGER :: I
> END TYPE MOD_T
> END MODULE M
>
> use m, only: local => mod_t
> type, extends(local) :: my_t
> end my_t
> type(my_t) :: my
>
> Does "my" contain "my%local" or "my%mod_t" ?
>
> According to NAG f95 it is "my%mod_t". I tried to read the Fortran
> standard, but I cannot get to a definite conclusion. Reading only
> "4.5.6 Type extension" I got the impression that "my%local" is
> correct. However, reading "11.2.1 The USE statement and use
> association", I'm not sure whether the parent name really changes or
> whether "local" is merely a "local identifier" for "mod_t" and thus
> the parent name stays "mod_t". Can someone help me with reading the
> standard?
>
> "The parent type of an extended type is the type named in the EXTENDS
> attribute specification."
> "NOTE 4.49 The name of the parent type might be a local name
> introduced via renaming in a USE statement."
> "An extended type has a scalar, nonpointer, nonallocatable, 1 parent
> component with the type and type parameters of the parent type. The
> name of this component is the parent type name."
>
> Tobias
For what it's worth, the IBM compiler interprets it the same way as
the NAG compiler. I'll be interested to hear from those who know the
standard well enough to respond to your question.
Damian


|