aboutsummaryrefslogtreecommitdiffstats
path: root/gcc-4.9/gcc/testsuite/g++.dg/warn/Wchar-subscripts-2.C
blob: 2170cb20616edfa7f109c2db610bea6a6257e091 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/* PR c++/16307 */
// { dg-do compile }
// { dg-options "-Wchar-subscripts" }

extern volatile char bla;

char foo (const char *s)
{
    return s [bla];          // { dg-warning "array subscript" }
}

int main ()
{
    foo ("\x80");
}