summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/warn/Warray-bounds-2.C
blob: 796483e0e491551f1168b9afb762913e8d3dc9ac (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
/* { dg-do compile } */
/* Test that -Warray-bounds is enabled by -Wall */
/* { dg-options "-O2 -Wall" } */

int a[10];

int* f(void) {

    a[-1] = 0;             /* { dg-warning "array subscript" } */

    return a;
}