aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gcc/fortran/ChangeLog5
-rw-r--r--gcc/fortran/trans-decl.c3
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/gfortran.dg/intent_out_8.f9017
4 files changed, 29 insertions, 1 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog
index 53e446e..fde23e5 100644
--- a/gcc/fortran/ChangeLog
+++ b/gcc/fortran/ChangeLog
@@ -1,3 +1,8 @@
+2013-08-20 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/53655
+ * trans-decl.c (generate_local_decl): Check if type has any components.
+
2013-08-19 Janus Weil <janus@gcc.gnu.org>
PR fortran/46271
diff --git a/gcc/fortran/trans-decl.c b/gcc/fortran/trans-decl.c
index 1708931..c2c736e 100644
--- a/gcc/fortran/trans-decl.c
+++ b/gcc/fortran/trans-decl.c
@@ -4745,7 +4745,8 @@ generate_local_decl (gfc_symbol * sym)
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",
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index f05e068..8b4e42f 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2013-08-20 Janus Weil <janus@gcc.gnu.org>
+
+ PR fortran/53655
+ * gfortran.dg/intent_out_8.f90: New.
+
2013-08-20 Teresa Johnson <tejohnson@google.com>
PR rtl-optimizations/57451
diff --git a/gcc/testsuite/gfortran.dg/intent_out_8.f90 b/gcc/testsuite/gfortran.dg/intent_out_8.f90
new file mode 100644
index 0000000..674d833
--- /dev/null
+++ b/gcc/testsuite/gfortran.dg/intent_out_8.f90
@@ -0,0 +1,17 @@
+! { dg-do compile }
+! { dg-options "-Wall" }
+!
+! PR 53655: [F03] "default initializer" warnings
+!
+! Contributed by Tobias Burnus <burnus@gcc.gnu.org>
+
+type t
+end type t
+
+contains
+
+ subroutine foo(x)
+ type(t), intent(out) :: x
+ end subroutine
+
+end