This is the mail archive of the
mailing list for the GCC project.
Re: [Patch, fortran] PR30880 - Derived types with default value -- function with ENTRY: rejected at compile time
- From: FX Coudert <fxcoudert at gmail dot com>
- To: "fortran at gcc dot gnu dot org List" <fortran at gcc dot gnu dot org>, gcc-patches List <gcc-patches at gcc dot gnu dot org>
- Cc: Paul Richard Thomas <paul dot richard dot thomas at gmail dot com>
- Date: Sun, 18 Mar 2007 11:55:30 +0100
- Subject: Re: [Patch, fortran] PR30880 - Derived types with default value -- function with ENTRY: rejected at compile time
2007-03-08 Paul Thomas <firstname.lastname@example.org>
* resolve.c (resolve_fl_variable): Set flag to 2 for automatic
arrays. Make condition for automatic array error explicit.
If a dummy, no error on an INTENT(OUT) derived type.
There's something I don't understand in the "if (sym->value && flag)"
block (below the "Reject illegal initializers" comment) when your
patch is applied. When we see a derived type dummy and multiple
entry, we'll set flag and enter that block of code. We then won't
emit an error, because of the condition you added:
! else if (sym->attr.dummy
! && !(sym->ts.type == BT_DERIVED && sym->attr.intent == INTENT_OUT))
gfc_error ("Dummy '%s' at %L cannot have an initializer",
but still, we will go to the last instruction of this block and
return FAILURE. If that is what you wanted it to do, it probably
needs a comment saying why, because it doesn't look trivial to me.
Indeed, I can understand why we want to short-circuit the end of the
function, but shouldn't we be returning SUCCESS?