diff options
author | kargl <kargl@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-11-05 20:57:12 +0000 |
---|---|---|
committer | kargl <kargl@138bc75d-0d04-0410-961f-82ee72b054a4> | 2009-11-05 20:57:12 +0000 |
commit | 7c0ca46e388feaf0a07c46ff999ea9355ba9f4a8 (patch) | |
tree | 51b62820b9127dc51fa1fb58697939df4a9a4a8d /gcc/fortran | |
parent | 21100898bcd3a99205f8506617bd46da165bc448 (diff) | |
download | gcc-7c0ca46e388feaf0a07c46ff999ea9355ba9f4a8.tar.gz |
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.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@153952 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/fortran')
-rw-r--r-- | gcc/fortran/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/fortran/trans-decl.c | 8 |
2 files changed, 12 insertions, 2 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 3a1aa638ec3..eef8cf8d5a0 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 8ac6b9acc19..200c3f5654c 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, |