diff options
author | Jerry DeLisle <jvdelisle@gcc.gnu.org> | 2015-05-16 17:44:15 +0000 |
---|---|---|
committer | Jerry DeLisle <jvdelisle@gcc.gnu.org> | 2015-05-16 17:44:15 +0000 |
commit | c55bbc72ffaabcab433cdcce28ba69d21c35e21c (patch) | |
tree | 089860d1f3693f3bf8a29396280847bd59157cb2 | |
parent | 7e8655412c7e9438f76e417f055db2505133a949 (diff) | |
download | gcc-c55bbc72ffaabcab433cdcce28ba69d21c35e21c.zip gcc-c55bbc72ffaabcab433cdcce28ba69d21c35e21c.tar.gz gcc-c55bbc72ffaabcab433cdcce28ba69d21c35e21c.tar.bz2 |
re PR fortran/65903 (Line continuation followed by comment character in string fails to compile)
2015-05-16 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
and add a check for quotes and return.
From-SVN: r223248
-rw-r--r-- | gcc/fortran/ChangeLog | 8 | ||||
-rw-r--r-- | gcc/fortran/io.c | 2 | ||||
-rw-r--r-- | gcc/fortran/scanner.c | 18 |
3 files changed, 14 insertions, 14 deletions
diff --git a/gcc/fortran/ChangeLog b/gcc/fortran/ChangeLog index 002a147..dcdf95e 100644 --- a/gcc/fortran/ChangeLog +++ b/gcc/fortran/ChangeLog @@ -1,3 +1,11 @@ +2015-05-16 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 + and add a check for quotes and return. + 2015-05-16 Thomas Koenig <tkoenig@gcc.gnu.org> PR fortran/66113 diff --git a/gcc/fortran/io.c b/gcc/fortran/io.c index 7ba6b09..82a0a87 100644 --- a/gcc/fortran/io.c +++ b/gcc/fortran/io.c @@ -385,7 +385,7 @@ format_lex (void) if (c == delim) { - c = next_char (INSTRING_NOWARN); + c = next_char (NONSTRING); if (c == '\0') { diff --git a/gcc/fortran/scanner.c b/gcc/fortran/scanner.c index 55b3625..e524345 100644 --- a/gcc/fortran/scanner.c +++ b/gcc/fortran/scanner.c @@ -1272,21 +1272,11 @@ restart: are still in a string and we are looking for a possible doubled quote and we end up here. See PR64506. */ - if (in_string) + if (in_string && c != '\n') { gfc_current_locus = old_loc; - - if (c == '!') - { - skip_comment_line (); - goto restart; - } - - if (c != '\n') - { - c = '&'; - goto done; - } + c = '&'; + goto done; } if (c != '!' && c != '\n') @@ -1392,6 +1382,8 @@ restart: "Missing %<&%> in continued character " "constant at %C"); } + else if (!in_string && (c == '\'' || c == '"')) + goto done; /* Both !$omp and !$ -fopenmp continuation lines have & on the continuation line only optionally. */ else if (openmp_flag || openacc_flag || openmp_cond_flag) |