------- Comment #12 from janus at gcc dot gnu dot org  2010-03-04 12:06 -------
(In reply to comment #11)
> I think it dates back to punch cards;

Yes, I've seen those. However, being born too late, I never had the chance to
use them :)


> > I wouldn't expect anyone to use F03 FINAL statements in F77 fixed source
> > form anyways.
> 
> I do not agree.

Ok then, let's just do this:

Index: gcc/fortran/decl.c
===================================================================
--- gcc/fortran/decl.c  (revision 157216)
+++ gcc/fortran/decl.c  (working copy)
@@ -7810,8 +7810,17 @@ gfc_match_final_decl (void)
   bool first, last;
   gfc_symbol* block;

+  if (gfc_current_form == FORM_FREE)
+    {
+      char c = gfc_peek_ascii_char ();
+      if (!gfc_is_whitespace (c) && c != ':')
+       return MATCH_NO;
+    }
+  
   if (gfc_state_stack->state != COMP_DERIVED_CONTAINS)
     {
+      if (gfc_current_form == FORM_FIXED)
+       return MATCH_NO;
       gfc_error ("FINAL declaration at %C must be inside a derived type "
                 "CONTAINS section");
       return MATCH_ERROR;


Ok to commit (after a regtest and with the test case from comment #0)?


-- 

janus at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|unassigned at gcc dot gnu   |janus at gcc dot gnu dot org
                   |dot org                     |
             Status|UNCONFIRMED                 |ASSIGNED
     Ever Confirmed|0                           |1
   Last reconfirmed|0000-00-00 00:00:00         |2010-03-04 12:06:50
               date|                            |


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

Reply via email to