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/testsuite | |
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/testsuite')
-rw-r--r-- | gcc/testsuite/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/pr64423.c | 13 |
2 files changed, 18 insertions, 0 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 1690e7b..7293521 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2015-01-05 Marek Polacek <polacek@redhat.com> + + PR c/64423 + * gcc.dg/pr64423.c: New test. + 2015-01-05 Hans-Peter Nilsson <hp@bitrange.com> * gcc.dg/debug/debug-1.c: Pass -fno-if-conversion for diff --git a/gcc/testsuite/gcc.dg/pr64423.c b/gcc/testsuite/gcc.dg/pr64423.c new file mode 100644 index 0000000..c228acb --- /dev/null +++ b/gcc/testsuite/gcc.dg/pr64423.c @@ -0,0 +1,13 @@ +/* PR c/64423 */ +/* { dg-do compile } */ +/* { dg-options "-Wchar-subscripts" } */ + +int a[100]; + +int +f (char c) +{ + return a[c] /* { dg-warning "11:array subscript has type .char." } */ + + a[c] /* { dg-warning "14:array subscript has type .char." } */ + + a[c]; /* { dg-warning "16:array subscript has type .char." } */ +} |