gcc/testsuite/g++.dg/init/const12.C
raw| 1 | // PR c++/69688 |
| 2 | // { dg-do compile } |
| 3 | // { dg-options "-Wsign-compare" } |
| 4 | |
| 5 | struct S |
| 6 | { |
| 7 | static const int s; |
| 8 | static const char c[]; |
| 9 | static wchar_t w[]; |
| 10 | |
| 11 | S () |
| 12 | { |
| 13 | for (int i = 0; i < s; i++) |
| 14 | w[i] = 0; |
| 15 | } |
| 16 | }; |
| 17 | |
| 18 | const char S::c[] = "x"; |
| 19 | const int S::s = sizeof (S::c) - 1; |
| 20 | wchar_t S::w[S::s]; |