This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] PR c++/16307


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]