re PR fortran/41918 (Superflous warning "was declared INTENT(OUT) but was not set")

2009-11-03  Steven G. Kargl  <kargl@gcc.gnu.org>

	PR fortran/41918
	* fortran/trans-decl.c: Silence intent(out) warning for derived type
	dummy arguments with default initialization.

From-SVN: r153952
This commit is contained in:
Steven G. Kargl 2009-11-05 20:57:12 +00:00
parent 2799d18c92
commit ad6d42e16a
2 changed files with 12 additions and 2 deletions

View File

@ -1,3 +1,9 @@
2009-11-05 Steven G. Kargl <kargl@gcc.gnu.org>
PR fortran/41918
* fortran/trans-decl.c: Silence intent(out) warning for derived type
dummy arguments with default initialization.
2009-11-05 Janus Weil <janus@gcc.gnu.org>
PR fortran/41556

View File

@ -3776,8 +3776,12 @@ generate_local_decl (gfc_symbol * sym)
else if (warn_unused_variable
&& sym->attr.dummy
&& sym->attr.intent == INTENT_OUT)
gfc_warning ("Dummy argument '%s' at %L was declared INTENT(OUT) but was not set",
sym->name, &sym->declared_at);
{
if (!(sym->ts.type == BT_DERIVED
&& sym->ts.u.derived->components->initializer))
gfc_warning ("Dummy argument '%s' at %L was declared INTENT(OUT) "
"but was not set", sym->name, &sym->declared_at);
}
/* Specific warning for unused dummy arguments. */
else if (warn_unused_variable && sym->attr.dummy)
gfc_warning ("Unused dummy argument '%s' at %L", sym->name,