17 lines · cpp
1class Foo {2public:3 int a;4 int b;5 virtual int Sum() { return a + b; }6};7 8struct Foo *GetAFoo() {9 return (struct Foo*)0;10}11 12int main() {13 struct Foo *foo = GetAFoo();14 return foo->Sum();15}16 17 1class Foo {2public:3 int a;4 int b;5 virtual int Sum() { return a + b; }6};7 8struct Foo *GetAFoo() {9 return (struct Foo*)0;10}11 12int main() {13 struct Foo *foo = GetAFoo();14 return foo->Sum();15}16 17