1union Foo {
2 int val = 42;
3 static const int sVal1 = -42;
4 static Foo sVal2;
5};
6
7Foo Foo::sVal2{};
8
9namespace {
10union Bar {
11 int val = 137;
12 static const int sVal1 = -137;
13 static Bar sVal2;
14};
15
16Bar Bar::sVal2{};
17} // namespace
18
19int main() {
20 Foo foo;
21 Bar bar;
22 auto sum = Bar::sVal1 + Foo::sVal1 + Foo::sVal2.val + Bar::sVal2.val;
23
24 return 0;
25}
26

source code of lldb/test/API/lang/cpp/union-static-data-members/main.cpp