Debian Codegraph @

gcc/testsuite/g++.dg/warn/Wsizeof-array-div2.C

raw
1 // PR c++/91741
2 // { dg-do compile { target { lp64 } } }
3 // { dg-options "-Wall" }
4 // From <https://www.viva64.com/en/examples/v706/>.
5
6 const int kBaudrates[] = { 50, 75, 110 };
7
8 void
9 foo ()
10 {
11 for(int i = sizeof(kBaudrates) / sizeof(char*); // { dg-warning "expression does not compute" }
12 --i >= 0;)
13 {
14 }
15 }