diff options
author | Jakub Jelinek <jakub@redhat.com> | 2018-11-21 23:41:07 +0100 |
---|---|---|
committer | Jakub Jelinek <jakub@gcc.gnu.org> | 2018-11-21 23:41:07 +0100 |
commit | e1389417f9bc364b49f8bef9583e34a8db3a4049 (patch) | |
tree | f48a49c14ccc9d7c433682c187eefe2cb8cb8d49 /libstdc++-v3 | |
parent | 13986a58e723e4608ce0172d6713a7a9b06a4c30 (diff) | |
download | gcc-e1389417f9bc364b49f8bef9583e34a8db3a4049.zip gcc-e1389417f9bc364b49f8bef9583e34a8db3a4049.tar.gz gcc-e1389417f9bc364b49f8bef9583e34a8db3a4049.tar.bz2 |
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
Diffstat (limited to 'libstdc++-v3')
8 files changed, 19 insertions, 7 deletions
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog index 0ad33da..a77596e 100644 --- a/libstdc++-v3/ChangeLog +++ b/libstdc++-v3/ChangeLog @@ -1,3 +1,15 @@ +2018-11-21 Jakub Jelinek <jakub@redhat.com> + + PR c++/87386 + * 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. + 2018-11-21 Jonathan Wakely <jwakely@redhat.com> PR libstdc++/88111 diff --git a/libstdc++-v3/testsuite/20_util/scoped_allocator/69293_neg.cc b/libstdc++-v3/testsuite/20_util/scoped_allocator/69293_neg.cc index 168079f..638d8da 100644 --- a/libstdc++-v3/testsuite/20_util/scoped_allocator/69293_neg.cc +++ b/libstdc++-v3/testsuite/20_util/scoped_allocator/69293_neg.cc @@ -46,5 +46,5 @@ test01() scoped_alloc sa; auto p = sa.allocate(1); sa.construct(p); // this is required to be ill-formed - // { dg-error "static assertion failed" "" { target *-*-* } 94 } + // { dg-error "static assertion failed" "" { target *-*-* } 96 } } diff --git a/libstdc++-v3/testsuite/20_util/uses_allocator/69293_neg.cc b/libstdc++-v3/testsuite/20_util/uses_allocator/69293_neg.cc index eaf4324..0f16cd6 100644 --- a/libstdc++-v3/testsuite/20_util/uses_allocator/69293_neg.cc +++ b/libstdc++-v3/testsuite/20_util/uses_allocator/69293_neg.cc @@ -44,5 +44,5 @@ test01() { alloc_type a; std::tuple<X> t(std::allocator_arg, a); // this is required to be ill-formed - // { dg-error "static assertion failed" "" { target *-*-* } 94 } + // { dg-error "static assertion failed" "" { target *-*-* } 96 } } diff --git a/libstdc++-v3/testsuite/20_util/uses_allocator/cons_neg.cc b/libstdc++-v3/testsuite/20_util/uses_allocator/cons_neg.cc index bb8c38d..73ed2b5 100644 --- a/libstdc++-v3/testsuite/20_util/uses_allocator/cons_neg.cc +++ b/libstdc++-v3/testsuite/20_util/uses_allocator/cons_neg.cc @@ -43,4 +43,4 @@ void test01() tuple<Type> t(allocator_arg, a, 1); } -// { dg-error "static assertion failed" "" { target *-*-* } 94 } +// { dg-error "static assertion failed" "" { target *-*-* } 96 } diff --git a/libstdc++-v3/testsuite/experimental/propagate_const/requirements2.cc b/libstdc++-v3/testsuite/experimental/propagate_const/requirements2.cc index fa5193e..0c48ac9 100644 --- a/libstdc++-v3/testsuite/experimental/propagate_const/requirements2.cc +++ b/libstdc++-v3/testsuite/experimental/propagate_const/requirements2.cc @@ -21,7 +21,7 @@ using std::experimental::propagate_const; -// { dg-error "requires a class or a pointer to an object type" "" { target *-*-* } 105 } +// { dg-error "requires a class or a pointer to an object type" "" { target *-*-* } 107 } // { dg-error "not a pointer-to-object type" "" { target *-*-* } 66 } // { dg-error "forming pointer to reference type" "" { target *-*-* } 187 } // { dg-error "forming pointer to reference type" "" { target *-*-* } 213 } diff --git a/libstdc++-v3/testsuite/experimental/propagate_const/requirements3.cc b/libstdc++-v3/testsuite/experimental/propagate_const/requirements3.cc index fc7c30f..63aebef 100644 --- a/libstdc++-v3/testsuite/experimental/propagate_const/requirements3.cc +++ b/libstdc++-v3/testsuite/experimental/propagate_const/requirements3.cc @@ -21,6 +21,6 @@ using std::experimental::propagate_const; -// { dg-error "requires a class or a pointer to an object type" "" { target *-*-* } 105 } +// { dg-error "requires a class or a pointer to an object type" "" { target *-*-* } 107 } propagate_const<void (*)()> test1; diff --git a/libstdc++-v3/testsuite/experimental/propagate_const/requirements4.cc b/libstdc++-v3/testsuite/experimental/propagate_const/requirements4.cc index 65cee4e..50303c9 100644 --- a/libstdc++-v3/testsuite/experimental/propagate_const/requirements4.cc +++ b/libstdc++-v3/testsuite/experimental/propagate_const/requirements4.cc @@ -21,7 +21,7 @@ using std::experimental::propagate_const; -// { dg-error "requires a class or a pointer to an object type" "" { target *-*-* } 105 } +// { dg-error "requires a class or a pointer to an object type" "" { target *-*-* } 107 } // { dg-error "invalid type" "" { target *-*-* } 66 } // { dg-error "uninitialized reference member" "" { target *-*-* } 112 } diff --git a/libstdc++-v3/testsuite/experimental/propagate_const/requirements5.cc b/libstdc++-v3/testsuite/experimental/propagate_const/requirements5.cc index ae98fb8..b80600e 100644 --- a/libstdc++-v3/testsuite/experimental/propagate_const/requirements5.cc +++ b/libstdc++-v3/testsuite/experimental/propagate_const/requirements5.cc @@ -21,6 +21,6 @@ using std::experimental::propagate_const; -// { dg-error "requires a class or a pointer to an object type" "" { target *-*-* } 105 } +// { dg-error "requires a class or a pointer to an object type" "" { target *-*-* } 107 } propagate_const<int[1]> test1; |