This is the mail archive of the
fortran@gcc.gnu.org
mailing list for the GNU Fortran project.
Re: [Patch, Fortran, F03] PR 39630: Procedure Pointer Components with PASS
- From: Tobias Burnus <burnus at net-b dot de>
- To: Daniel Kraft <d at domob dot eu>
- Cc: Janus Weil <janus at gcc dot gnu dot org>, gfortran <fortran at gcc dot gnu dot org>, gcc patches <gcc-patches at gcc dot gnu dot org>
- Date: Fri, 24 Jul 2009 21:41:35 +0200
- Subject: Re: [Patch, Fortran, F03] PR 39630: Procedure Pointer Components with PASS
- References: <854832d40907240924v68a8b943l169c805cab9571b6@mail.gmail.com> <4A6A0C02.3020700@domob.eu>
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