diff options
author | Marek Polacek <polacek@redhat.com> | 2015-01-05 12:03:57 +0000 |
---|---|---|
committer | Marek Polacek <mpolacek@gcc.gnu.org> | 2015-01-05 12:03:57 +0000 |
commit | 5bd012f83bcedad0e80280ffccaa0b5297d9bf98 (patch) | |
tree | 75038e2677f4f5b9b1ff57bf2ea4050b56336f91 /gcc/cp | |
parent | 2c5103ffdd6542ac1f9a110f144034d9ec70488c (diff) | |
download | gcc-5bd012f83bcedad0e80280ffccaa0b5297d9bf98.zip gcc-5bd012f83bcedad0e80280ffccaa0b5297d9bf98.tar.gz gcc-5bd012f83bcedad0e80280ffccaa0b5297d9bf98.tar.bz2 |
re PR c/64423 (Incorrect column number of -Wchar-subscripts)
PR c/64423
c-family/
* c-common.c (warn_array_subscript_with_type_char): Add location_t
parameter. Use it.
* c-common.h (warn_array_subscript_with_type_char): Update
declaration.
c/
* c-typeck.c (build_array_ref): Pass loc down to
warn_array_subscript_with_type_char.
cp/
* typeck.c (cp_build_array_ref): Pass loc down to
warn_array_subscript_with_type_char.
testsuite/
* gcc.dg/pr64423.c: New test.
From-SVN: r219186
Diffstat (limited to 'gcc/cp')
-rw-r--r-- | gcc/cp/ChangeLog | 6 | ||||
-rw-r--r-- | gcc/cp/typeck.c | 4 |
2 files changed, 8 insertions, 2 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index a6ce50b..de34ef9 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2015-01-05 Marek Polacek <polacek@redhat.com> + + PR c/64423 + * typeck.c (cp_build_array_ref): Pass loc down to + warn_array_subscript_with_type_char. + 2014-12-31 Iain Sandoe <iain@codesourcery.com> * parser.c (cp_parser_primary_expression): If parsing an diff --git a/gcc/cp/typeck.c b/gcc/cp/typeck.c index 9368b49..fc85ec3 100644 --- a/gcc/cp/typeck.c +++ b/gcc/cp/typeck.c @@ -3081,7 +3081,7 @@ cp_build_array_ref (location_t loc, tree array, tree idx, { tree rval, type; - warn_array_subscript_with_type_char (idx); + warn_array_subscript_with_type_char (loc, idx); if (!INTEGRAL_OR_UNSCOPED_ENUMERATION_TYPE_P (TREE_TYPE (idx))) { @@ -3191,7 +3191,7 @@ cp_build_array_ref (location_t loc, tree array, tree idx, return error_mark_node; } - warn_array_subscript_with_type_char (idx); + warn_array_subscript_with_type_char (loc, idx); ret = cp_build_indirect_ref (cp_build_binary_op (input_location, PLUS_EXPR, ar, ind, |