int printf(const char*, ...); struct A{ void foo(int p) { a=p; } int a;}; int main(){ A r; const_cast<A>(r).foo(101); printf("%d", r.a);}
Standard input is empty
prog.cpp: In function ‘int main()’: prog.cpp:12: error: invalid use of const_cast with type ‘A’, which is not a pointer, reference, nor a pointer-to-data-member type
Standard output is empty
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!