On Tue, May 12, 2020 at 2:24 PM Nathan Sidwell <nat...@acm.org> wrote: > > My recent C++ parser change to pay attention to EOF location uncovered a > separate bug. The preprocesor's EOF logic would set the EOF location to > be the beginning of the last line of text in the file -- not the 'line' > after that, which contains no characters. Mostly. This fixes things so > that when we attempt to read the last line of the main file, we don't > pop the buffer until the tokenizer has a chance to create an EOF token > with the correct location information. It is then responsible for > popping the buffer. As it happens, raw string literal tokenizing > contained a bug -- it would increment the line number prematurely, > because it cached buffer->cur in a local variable, but checked > buffer->cur before updating it to figure out if it was at end of file. > We fix up that too. > > The EOF token intentionally doesn't have a column number -- it's not a > position on a line, it's a non-existant line. > > The testsuite churn is just correcting the EOF location diagnostics. > This time I've made sure to check all testsuites, sorry obj-c++ folks. > > pushed to master. > > nathan > > -- > Nathan Sidwell
I got ERROR: gcc.dg/unclosed-init.c: syntax error in target selector ".+1" for " dg-error 3 "-: expected '.' at end of input" { target *-*-* } .+1 " ERROR: gcc.dg/unclosed-init.c: syntax error in target selector ".+1" for " dg-error 3 "-: expected '.' at end of input" { target *-*-* } .+1 " ERROR: gcc.dg/unclosed-init.c: syntax error in target selector ".+1" for " dg-error 3 "-: expected '.' at end of input" { target *-*-* } .+1 " ERROR: gcc.dg/unclosed-init.c: syntax error in target selector ".+1" for " dg-error 3 "-: expected '.' at end of input" { target *-*-* } .+1 " ERROR: gcc.dg/unclosed-init.c: syntax error in target selector ".+1" for " dg-error 3 "-: expected '.' at end of input" { target *-*-* } .+1 " ERROR: gcc.dg/unclosed-init.c: syntax error in target selector ".+1" for " dg-error 3 "-: expected '.' at end of input" { target *-*-* } .+1 " on Linux/x86: https://gcc.gnu.org/pipermail/gcc-regression/2020-May/072573.html -- H.J.