http://gcc.gnu.org/bugzilla/show_bug.cgi?id=53655

--- Comment #4 from janus at gcc dot gnu.org ---
(In reply to Tobias Burnus from comment #1)
> a) For foo's "x" there is the warning:
> "Derived-type dummy argument 'x' at (1) was declared INTENT(OUT) but was not
> set and does not have a default initializer"
> As "t" has no components, the warning doesn't make sense.

This is easily fixed by the following:

Index: gcc/fortran/trans-decl.c
===================================================================
--- gcc/fortran/trans-decl.c    (revision 201834)
+++ gcc/fortran/trans-decl.c    (working copy)
@@ -4745,7 +4745,8 @@
         gfc_warning ("Dummy argument '%s' at %L was declared "
                  "INTENT(OUT) but was not set",  sym->name,
                  &sym->declared_at);
-          else if (!gfc_has_default_initializer (sym->ts.u.derived))
+          else if (!gfc_has_default_initializer (sym->ts.u.derived)
+               && !sym->ts.u.derived->attr.zero_comp)
         gfc_warning ("Derived-type dummy argument '%s' at %L was "
                  "declared INTENT(OUT) but was not set and "
                  "does not have a default initializer",

Reply via email to