EOF has a location
authorNathan Sidwell <nathan@acm.org>
Fri, 8 May 2020 15:43:16 +0000 (08:43 -0700)
committerNathan Sidwell <nathan@acm.org>
Fri, 8 May 2020 15:47:13 +0000 (08:47 -0700)
commitdebfaee5d51e3c07bb88a971618de2baff35d9c0
tree2235ab59ddd814c6f88ce14e1d6e112636fc1a6d
parente34495985e49545c468e664ee10bd0e66c7395bf
EOF has a location

There's no need to special-case EOF's location.  For the complete file we
give it a legitimate location.  And for deferred parses we now zap a temporary EOF
onto the next token, so we can just use its location anyway.

gcc/cp/
* parser.c (cp_lexer_set_source_position_from_token): EOF has a
location too.

gcc/testsuite/
* c-c++-common/raw-string-6.c: Adjust EOF error location.
* g++.dg/cpp0x/decltype63.C: Likewise.
* g++.dg/cpp0x/gen-attrs-64.C: Likewise.
* g++.dg/cpp0x/pr68726.C: Likewise.
* g++.dg/cpp0x/pr78341.C: Likewise.
* g++.dg/cpp1y/pr65202.C: Likewise.
* g++.dg/cpp1z/class-deduction44.C: Likewise.
* g++.dg/diagnostic/unclosed-extern-c.C: Likewise.
* g++.dg/diagnostic/unclosed-function.C: Likewise.
* g++.dg/diagnostic/unclosed-namespace.C: Likewise.
* g++.dg/diagnostic/unclosed-struct.C: Likewise.
* g++.dg/ext/pr84598.C: Likewise.
* g++.dg/other/switch4.C: Likewise.
* g++.dg/parse/crash10.C: Likewise.
* g++.dg/parse/crash18.C: Likewise.
* g++.dg/parse/crash35.C: Likewise.
* g++.dg/parse/crash59.C: Likewise.
* g++.dg/parse/crash61.C: Likewise.
* g++.dg/parse/crash67.C: Likewise.
* g++.dg/parse/ctor3.C: Likewise.
* g++.dg/parse/error14.C: Likewise.
* g++.dg/parse/error5.C: Likewise.
* g++.dg/parse/error56.C: Likewise.
* g++.dg/parse/invalid1.C: Likewise.
* g++.dg/parse/parameter-declaration-1.C: Likewise.
* g++.dg/parse/parser-pr28152-2.C: Likewise.
* g++.dg/parse/parser-pr28152.C: Likewise.
* g++.dg/parse/pr68722.C: Likewise.
* g++.dg/pr46852.C: Likewise.
* g++.dg/pr46868.C: Likewise.
* g++.dg/template/crash115.C: Likewise.
* g++.dg/template/crash43.C: Likewise.
* g++.dg/template/error-recovery1.C: Likewise.
* g++.dg/template/error57.C: Likewise.
* g++.old-deja/g++.other/crash31.C: Likewise.
38 files changed:
gcc/cp/ChangeLog
gcc/cp/parser.c
gcc/testsuite/ChangeLog
gcc/testsuite/c-c++-common/raw-string-6.c
gcc/testsuite/g++.dg/cpp0x/decltype63.C
gcc/testsuite/g++.dg/cpp0x/gen-attrs-64.C
gcc/testsuite/g++.dg/cpp0x/pr68726.C
gcc/testsuite/g++.dg/cpp0x/pr78341.C
gcc/testsuite/g++.dg/cpp1y/pr65202.C
gcc/testsuite/g++.dg/cpp1z/class-deduction44.C
gcc/testsuite/g++.dg/diagnostic/unclosed-extern-c.C
gcc/testsuite/g++.dg/diagnostic/unclosed-function.C
gcc/testsuite/g++.dg/diagnostic/unclosed-namespace.C
gcc/testsuite/g++.dg/diagnostic/unclosed-struct.C
gcc/testsuite/g++.dg/ext/pr84598.C
gcc/testsuite/g++.dg/other/switch4.C
gcc/testsuite/g++.dg/parse/crash10.C
gcc/testsuite/g++.dg/parse/crash18.C
gcc/testsuite/g++.dg/parse/crash35.C
gcc/testsuite/g++.dg/parse/crash59.C
gcc/testsuite/g++.dg/parse/crash61.C
gcc/testsuite/g++.dg/parse/crash67.C
gcc/testsuite/g++.dg/parse/ctor3.C
gcc/testsuite/g++.dg/parse/error14.C
gcc/testsuite/g++.dg/parse/error5.C
gcc/testsuite/g++.dg/parse/error56.C
gcc/testsuite/g++.dg/parse/invalid1.C
gcc/testsuite/g++.dg/parse/parameter-declaration-1.C
gcc/testsuite/g++.dg/parse/parser-pr28152-2.C
gcc/testsuite/g++.dg/parse/parser-pr28152.C
gcc/testsuite/g++.dg/parse/pr68722.C
gcc/testsuite/g++.dg/pr46852.C
gcc/testsuite/g++.dg/pr46868.C
gcc/testsuite/g++.dg/template/crash115.C
gcc/testsuite/g++.dg/template/crash43.C
gcc/testsuite/g++.dg/template/error-recovery1.C
gcc/testsuite/g++.dg/template/error57.C
gcc/testsuite/g++.old-deja/g++.other/crash31.C