gcc/testsuite/g++.dg/cpp0x/union8.C
raw| 1 | // PR c++/78890 |
| 2 | // { dg-do compile { target c++11 } } |
| 3 | |
| 4 | union Test1 { |
| 5 | static int kConstant; |
| 6 | }; |
| 7 | |
| 8 | union Test2 { |
| 9 | static const int kConstant; |
| 10 | }; |
| 11 | |
| 12 | const int Test2::kConstant = 10; |
| 13 | |
| 14 | int k; |
| 15 | |
| 16 | union Test3 { |
| 17 | static int& kRef; |
| 18 | }; |
| 19 | |
| 20 | int& Test3::kRef = k; |
| 21 | |
| 22 | union Test4 { |
| 23 | static const int& kRef; |
| 24 | }; |
| 25 | |
| 26 | const int& Test4::kRef = 10; |