re PR c++/87386 (Error message for static_assert show wrong range)
authorJakub Jelinek <jakub@redhat.com>
Wed, 21 Nov 2018 22:41:07 +0000 (23:41 +0100)
committerJakub Jelinek <jakub@gcc.gnu.org>
Wed, 21 Nov 2018 22:41:07 +0000 (23:41 +0100)
commite1389417f9bc364b49f8bef9583e34a8db3a4049
treef48a49c14ccc9d7c433682c187eefe2cb8cb8d49
parent13986a58e723e4608ce0172d6713a7a9b06a4c30
re PR c++/87386 (Error message for static_assert show wrong range)

PR c++/87386
* parser.c (cp_parser_primary_expression): Use
id_expression.get_location () instead of id_expr_token->location.
Adjust the range from id_expr_token->location to
id_expressio.get_finish ().
(cp_parser_operator_function_id): Pass location of the operator
token down to cp_parser_operator.
(cp_parser_operator): Add start_loc argument, always construct a
location with caret at start_loc and range from start_loc to the
finish of the last token.
gcc/testsuite/
* g++.dg/diagnostic/pr87386.C: New test.
* g++.dg/parse/error17.C: Adjust expected diagnostics.
libstdc++-v3/
* testsuite/20_util/scoped_allocator/69293_neg.cc: Adjust expected
line.
* testsuite/20_util/uses_allocator/cons_neg.cc: Likewise.
* testsuite/20_util/uses_allocator/69293_neg.cc: Likewise.
* testsuite/experimental/propagate_const/requirements2.cc: Likewise.
* testsuite/experimental/propagate_const/requirements3.cc: Likewise.
* testsuite/experimental/propagate_const/requirements4.cc: Likewise.
* testsuite/experimental/propagate_const/requirements5.cc: Likewise.

From-SVN: r266359
13 files changed:
gcc/cp/ChangeLog
gcc/cp/parser.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/diagnostic/pr87386.C [new file with mode: 0644]
gcc/testsuite/g++.dg/parse/error17.C
libstdc++-v3/ChangeLog
libstdc++-v3/testsuite/20_util/scoped_allocator/69293_neg.cc
libstdc++-v3/testsuite/20_util/uses_allocator/69293_neg.cc
libstdc++-v3/testsuite/20_util/uses_allocator/cons_neg.cc
libstdc++-v3/testsuite/experimental/propagate_const/requirements2.cc
libstdc++-v3/testsuite/experimental/propagate_const/requirements3.cc
libstdc++-v3/testsuite/experimental/propagate_const/requirements4.cc
libstdc++-v3/testsuite/experimental/propagate_const/requirements5.cc