1 2 3 4 5 6 7 8 9 10 11 12 13 | #include <iostream> using namespace std; class X { static const int x; enum { y = &x }; }; int main() { return 0; } |
I2luY2x1ZGUgPGlvc3RyZWFtPgoKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmNsYXNzIFggewogICAgc3RhdGljIGNvbnN0IGludCB4OwogICAgZW51bSB7IHkgPSAmeCB9Owp9OwoKaW50IG1haW4oKSB7CgkKCXJldHVybiAwOwp9
prog.cpp:7: error: ‘X::x’ cannot appear in a constant-expression prog.cpp:7: error: `&' cannot appear in a constant-expression
-
result: Compilation error (maybe you wish to see an example for C++ 4.7.2)


