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

            Bug ID: 64506
           Summary: FORMAT Parse Error with Continuation Line
           Product: gcc
           Version: 4.9.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: fortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: thfanning at gmail dot com

Created attachment 34385
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=34385&action=edit
Sample program to illustrate parse error.

In a FORMAT statement, a character literal immediately followed by a
continuation character (&) and then a comment character (!) results in a parse
error. A simple program is attached that implements the following statements:

100 format('This format is OK.'&
    )
200 format('This format fails.'&!comment
    )
300 format('This format fails.'& !comment
    )
400 format('This format is OK.' &!comment
    )
500 format('This format is OK.' & !comment
    )

Compiling this results in the following:

200 format('This format fails.'&!comment
                                1
Error: Unexpected element '&' in format string at (1)
gfortran_parse_error.f90:13.32:

300 format('This format fails.'& !comment
                                1
Error: Unexpected element '&' in format string at (1)

Reply via email to