2 // Shows that problem of initializing one object's vtable pointer from
3 // another object's vtable pointer when doing a default copy of it
4 // and the vtable pointer involved is the main one.
6 // Correct answer is B::print.
7 // g++ prints D::print, which is wrong. Cfront gets is right.
11 extern "C" int printf(const char *, ...);
12 extern "C" void exit(int);
16 virtual void print(void) const { printf("B::print\n"); }
21 void print(void) const { printf("D::print\n"); exit(1); }
22 B compute(void) const;
25 B D::compute(void) const
33 titi.compute().print();