decl.c (grokdeclarator): Use id_loc in five additional places in the last part of...
authorPaolo Carlini <paolo.carlini@oracle.com>
Thu, 13 Jun 2019 08:45:46 +0000 (08:45 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Thu, 13 Jun 2019 08:45:46 +0000 (08:45 +0000)
commit52ffa82671d74d4b1bf4551643e48213e57ae5c4
treead71e6a1ffd5174dc126f70cc0b2c6345bfdba54
parenta8b98e2fc074dfb6c9419efbe70ce4021a04f356
decl.c (grokdeclarator): Use id_loc in five additional places in the last part of the function.

/cp
2019-06-13  Paolo Carlini  <paolo.carlini@oracle.com>

* decl.c (grokdeclarator): Use id_loc in five additional places
in the last part of the function.

/testsuite
2019-06-13  Paolo Carlini  <paolo.carlini@oracle.com>

* g++.dg/diagnostic/variably-modified-type-1.C: New.
* g++.dg/cpp0x/alias-decl-1.C: Test the location too.
* g++.dg/other/pr84792-1.C: Likewise.
* g++.dg/other/pr84792-2.C: Likewise.
* g++.dg/parse/error24.C: Likewise.
* g++.dg/parse/error32.C: Likewise.
* g++.dg/parse/error33.C: Likewise.
* g++.dg/parse/saved1.C: Likewise.
* g++.dg/template/operator6.C: Likewise.
* g++.dg/template/pr61745.C: Likewise.
* g++.dg/template/typedef41.C: Likewise.
* g++.old-deja/g++.jason/crash10.C: Likewise.

/cp
2019-06-13  Paolo Carlini  <paolo.carlini@oracle.com>

* decl.c (grokdeclarator): Move further up the declaration of
id_loc, use it immediately, update its value after the loop
over declarator, use it again in the final part of function;
improve locations of error messages about multiple data types
and conflicting specifiers.

/testsuite
2019-06-13  Paolo Carlini  <paolo.carlini@oracle.com>

* g++.dg/diagnostic/conflicting-specifiers-1.C: New.
* g++.dg/diagnostic/two-or-more-data-types-1.C: Likewise.
* g++.dg/parse/error10.C: Adjust location.
* g++.dg/parse/pragma2.C: Likewise.

From-SVN: r272236
19 files changed:
gcc/cp/ChangeLog
gcc/cp/decl.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/alias-decl-1.C
gcc/testsuite/g++.dg/diagnostic/conflicting-specifiers-1.C [new file with mode: 0644]
gcc/testsuite/g++.dg/diagnostic/two-or-more-data-types-1.C [new file with mode: 0644]
gcc/testsuite/g++.dg/diagnostic/variably-modified-type-1.C [new file with mode: 0644]
gcc/testsuite/g++.dg/other/pr84792-1.C
gcc/testsuite/g++.dg/other/pr84792-2.C
gcc/testsuite/g++.dg/parse/error10.C
gcc/testsuite/g++.dg/parse/error24.C
gcc/testsuite/g++.dg/parse/error32.C
gcc/testsuite/g++.dg/parse/error33.C
gcc/testsuite/g++.dg/parse/pragma2.C
gcc/testsuite/g++.dg/parse/saved1.C
gcc/testsuite/g++.dg/template/operator6.C
gcc/testsuite/g++.dg/template/pr61745.C
gcc/testsuite/g++.dg/template/typedef41.C
gcc/testsuite/g++.old-deja/g++.jason/crash10.C