gcc-patches@gcc.gnu.org
[Top] [All Lists]

Re: [Patch, Fortran, F03] PR 39630: Procedure Pointer Components with

Subject: Re: [Patch, Fortran, F03] PR 39630: Procedure Pointer Components with PASS
From: Tobias Burnus
Date: Fri, 24 Jul 2009 21:41:35 +0200
Daniel Kraft schrieb:
> +      /* TODO: Make this an error once CLASS is implemented.  */
> +      if (!sym->attr.sequence)
> +        gfc_warning ("Polymorphic entities are not yet implemented,"
> +             " non-polymorphic passed-object dummy argument of '%s'"
> +             " at %L accepted", c->name, &c->loc);
> +
> +    }
>
> I may mistake here someting, but what has sym->attr.sequence to do
> with polymorphic entities?

Well, in SEQUENCE types there cannot be any polymorphic entities thus
using TYPE is fully correct and there should be no warning. Cf. Fortran
2003 (constraint about PASS) - last sentence after the semicolon:

"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)."

And what is extensible? Well 4.5.6 states:

"A nonsequence derived type that does not have the BIND attribute is an
extensible type."

For TBP this is no issue as TBP are not allowed in SEQUENCE types.
However, PPC are. (And neither is allowed in BIND(C) types - thus there
is no such check.)

Tobias

<Prev in Thread] Current Thread [Next in Thread>