diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 3a1aa638ec36b4f2713e46b16adeedf3ab5c7fdb..eef8cf8d5a0eb0b035f45a13b0c0899f2ead29e2 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -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 diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c index 8ac6b9acc1970d66b1516e1f284ab9085b4425d6..200c3f5654c931d119e0d625bb263117f8ce5721 100644 --- a/gcc/fortran/trans-decl.c +++ b/gcc/fortran/trans-decl.c @@ -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,