This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [Patch, fortran] PR30880 - Derived types with default value -- function with ENTRY: rejected at compile time


2007-03-08 Paul Thomas <pault@gcc.gnu.org>

	PR fortran/30880
	* 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",
  		   sym->name, &sym->declared_at);

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?


FX


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]