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

--- Comment #4 from janus at gcc dot gnu.org ---
Draft patch:

Index: gcc/fortran/decl.c
===================================================================
--- gcc/fortran/decl.c    (revision 201331)
+++ gcc/fortran/decl.c    (working copy)
@@ -4286,12 +4286,10 @@ gfc_match_data_decl (void)
           || current_ts.u.derived->attr.zero_comp))
     goto ok;

-      /* Now we have an error, which we signal, and then fix up
-     because the knock-on is plain and simple confusing.  */
       gfc_error_now ("Derived type at %C has not been previously defined "
              "and so cannot appear in a derived type definition");
-      current_attr.pointer = 1;
-      goto ok;
+      m = MATCH_ERROR;
+      goto cleanup;
     }

 ok:

Reply via email to