https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91714

kargl at gcc dot gnu.org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2019-09-20
                 CC|                            |kargl at gcc dot gnu.org
     Ever confirmed|0                           |1

--- Comment #2 from kargl at gcc dot gnu.org ---
Fixes the problem with "typea"

Index: gcc/fortran/decl.c
===================================================================
--- gcc/fortran/decl.c  (revision 275969)
+++ gcc/fortran/decl.c  (working copy)
@@ -10231,6 +10240,17 @@ gfc_match_derived_decl (void)
       return MATCH_ERROR;
     }

+  /*  In free source form, need to check for TYPE XXX as oppose to TYPEXXX. */ 
+  if (m == MATCH_NO && gfc_current_form == FORM_FREE)
+    {
+      char c = gfc_peek_ascii_char ();
+      if (!gfc_is_whitespace (c))
+       {
+         gfc_error ("Mangled derived type definition at %C");
+         return MATCH_NO;
+       }
+    }
+
   m = gfc_match (" %n ", name);
   if (m != MATCH_YES)
     return m;
@@ -10238,7 +10258,7 @@ gfc_match_derived_decl (void)
   /* Make sure that we don't identify TYPE IS (...) as a parameterized
      derived type named 'is'.
      TODO Expand the check, when 'name' = "is" by matching " (tname) "
-     and checking if this is a(n intrinsic) typename. his picks up
+     and checking if this is a(n intrinsic) typename.  This picks up
      misplaced TYPE IS statements such as in select_type_1.f03.  */
   if (gfc_peek_ascii_char () == '(')
     {

Reply via email to