[patch, fortran] [5/6 Regression] Line continuation followed by comment character in string fails to compile
Jerry DeLisle
jvdelisle@charter.net
Thu May 14 01:58:00 GMT 2015
The attached patch reverts a change I made for pr65456 which caused this
regression and adds a check for quotes farther down in the function. This
avoids treating a '!' in a string as a comment and wiping the rest of the line.
I found the added code is needed because an interposing quote was falling
through and being changed into an empty space at around line 1393. (I do not
recall the history of why that space is being done)
The patch also updates test case continuation_13.f90. I found another compiler I
use for comparison interprets the continuation differently and is inserting a
space that is not there. So the format at line 800 is handled differently now
with gfortran and the line 900 format example is added to test both cases with
and without a space just before the continuation.
I think now gfortran has this right, but I do not rule out that I am missing
some obscure rule. This begs a question about the space character substituted
near line 1393 in scanner.c, but at the moment I do not think it is related.
I have also added a test for the the original problem reported in this PR to
avoid future repeating of the problem. I will provide a Changelog entry for the
testsuite changes.
Regression tested on x86-64-linux. OK to trunk? followed to 5.1?
Regards,
Jerry
2015-05-14 Jerry DeLisle <jvdelisle@gcc.gnu.org>
PR fortran/65903
* io.c (format_lex): Change to NONSTRING when checking for
possible doubled quote.
* scanner.c (gfc_next_char_literal): Revert change from 64506,
add a check for quotes, and return.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr65903.diff
Type: text/x-patch
Size: 2169 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20150514/c57bd8b2/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pr65903.f90
Type: text/x-fortran
Size: 293 bytes
Desc: not available
URL: <http://gcc.gnu.org/pipermail/fortran/attachments/20150514/c57bd8b2/attachment-0001.bin>
More information about the Fortran
mailing list