diff options
author | Paolo Carlini <paolo.carlini@oracle.com> | 2019-08-14 08:56:58 +0000 |
---|---|---|
committer | Paolo Carlini <paolo@gcc.gnu.org> | 2019-08-14 08:56:58 +0000 |
commit | 917d611c56a58c38f2b6a7ba808d7a7ae7ed145c (patch) | |
tree | 248641091d2d1bb1dd64fdf2caaf6953c9437947 | |
parent | 2803bc3bbca332f53801770715a5b592b2467492 (diff) | |
download | gcc-917d611c56a58c38f2b6a7ba808d7a7ae7ed145c.zip gcc-917d611c56a58c38f2b6a7ba808d7a7ae7ed145c.tar.gz gcc-917d611c56a58c38f2b6a7ba808d7a7ae7ed145c.tar.bz2 |
decl.c (grokdeclarator): Use id_loc and EXPR_LOCATION in a few error messages.
/cp
2019-08-08 Paolo Carlini <paolo.carlini@oracle.com>
* decl.c (grokdeclarator): Use id_loc and EXPR_LOCATION in
a few error messages.
/testsuite
2019-08-08 Paolo Carlini <paolo.carlini@oracle.com>
* g++.dg/cpp0x/enum20.C: Test location(s) too.
* g++.dg/other/friend3.C: Likewise.
* g++.dg/parse/dtor5.C: Likewise.
* g++.dg/parse/friend7.C: Likewise.
* g++.dg/template/error22.C: Likewise.
* g++.old-deja/g++.brendan/err-msg5.C: Likewise.
From-SVN: r274435
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/decl2.c | 4 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/conversion/simd4.C | 12 |
4 files changed, 17 insertions, 8 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 3ae8e53..c3b91b0 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,10 @@ 2019-08-14 Paolo Carlini <paolo.carlini@oracle.com> + * decl2.c (grok_array_decl): Use the location of the open square + bracket in error message about invalid types. + +2019-08-14 Paolo Carlini <paolo.carlini@oracle.com> + * decl.c (grokdeclarator): Check here for typedef a function definition or a member function definition. (start_function): Adjust. diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index ad24592..a32108f 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -434,8 +434,8 @@ grok_array_decl (location_t loc, tree array_expr, tree index_exp, array_expr = p2, index_exp = i1; else { - error ("invalid types %<%T[%T]%> for array subscript", - type, TREE_TYPE (index_exp)); + error_at (loc, "invalid types %<%T[%T]%> for array subscript", + type, TREE_TYPE (index_exp)); return error_mark_node; } diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index db38df3..7820207 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2019-08-14 Paolo Carlini <paolo.carlini@oracle.com> + + * g++.dg/conversion/simd4.C: Test locations. + 2019-08-14 Richard Sandiford <richard.sandiford@arm.com> * gcc.target/aarch64/sve/peel_ind_1.c: Look for an inverted .B VL1. diff --git a/gcc/testsuite/g++.dg/conversion/simd4.C b/gcc/testsuite/g++.dg/conversion/simd4.C index f8f7f2e..22274a1 100644 --- a/gcc/testsuite/g++.dg/conversion/simd4.C +++ b/gcc/testsuite/g++.dg/conversion/simd4.C @@ -12,13 +12,13 @@ void foo () { b[t]; - b[u]; // { dg-error "invalid types" } - b[v]; // { dg-error "invalid types" } - b[w]; // { dg-error "invalid types" } + b[u]; // { dg-error "4:invalid types" } + b[v]; // { dg-error "4:invalid types" } + b[w]; // { dg-error "4:invalid types" } t[b]; - u[b]; // { dg-error "invalid types" } - v[b]; // { dg-error "invalid types" } - w[b]; // { dg-error "invalid types" } + u[b]; // { dg-error "4:invalid types" } + v[b]; // { dg-error "4:invalid types" } + w[b]; // { dg-error "4:invalid types" } new int[t]; new int[u]; // { dg-error "new-declarator must have integral" } new int[v]; // { dg-error "new-declarator must have integral" } |