This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] PR c++/16307
- From: Gabriel Dos Reis <gdr at integrable-solutions dot net>
- To: Dirk Mueller <dmuell at gmx dot net>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: 29 Oct 2006 02:40:19 +0200
- Subject: Re: [PATCH] PR c++/16307
- References: <200610290137.25679.dmuell@gmx.net>
Dirk Mueller <dmuell@gmx.net> writes:
| Hi,
|
| it seems the C++ frontend forgot to check for char subscriptions to pointers
| since apparently forever. bootstrapped, regtested on i686-suse-linux. Ok for
| mainline?
OK, with a minor correction.
[...]
| @@ -0,0 +1,13 @@
| +/* PR c++/16307 */
| +// { dg-do compile }
| +// { dg-options "-Wchar-subscripts" }
| +
| +char foo (const char *s)
| +{
| + return s [s ['\x80']]; // { dg-warning "array subscript" }
Why double indexing?
Please, test for one thing.
-- Gaby