gcc/testsuite/g++.dg/ext/visibility/anon7.C
raw| 1 | // PR c++/34094 |
| 2 | // { dg-do compile } |
| 3 | |
| 4 | namespace |
| 5 | { |
| 6 | struct A { |
| 7 | static int bar (); // { dg-error "used but never defined" } |
| 8 | static int i; // { dg-error "used, but not defined" "" { xfail *-*-* } } |
| 9 | static int j; |
| 10 | static int k; |
| 11 | static int l; |
| 12 | static const int m = 16; |
| 13 | static const int n = 17; |
| 14 | }; |
| 15 | int A::j = 4; |
| 16 | int A::k; |
| 17 | const int A::m; |
| 18 | } |
| 19 | |
| 20 | int foo (void) |
| 21 | { |
| 22 | return A::i + A::j + A::k + A::m + A::n + A::bar (); |
| 23 | } |