repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
S/390: Deprecate g5 and g6 CPU levels
[official-gcc.git]
/
gcc
/
testsuite
/
g++.dg
/
warn
/
Warray-bounds-6.C
blob
f2e5f2f597aa27b30ab2964e277220766641d5b8
1
// { dg-do compile }
2
// { dg-options "-O3 -Warray-bounds" }
3
4
struct type {
5
bool a, b;
6
bool get_b() { return b; }
7
};
8
9
type stuff[9u];
10
11
void bar();
12
13
void foo()
14
{
15
for(unsigned i = 0u; i < 9u; i++)
16
{
17
if(!stuff[i].a)
18
continue;
19
20
bar();
21
22
for(unsigned j = i + 1u; j < 9u; j++)
23
if(stuff[j].a && stuff[j].get_b()) // { dg-bogus "above array bounds" }
24
return;
25
}
26
}