1 // { dg-do run } 2 // prms-id: 3570 3 4 extern "C" int printf(const char *, ...); 5 6 struct A { printA7 void print() {printf("A");} 8 }; 9 10 struct B : A { 11 typedef A superB; printB12 void print() {superB::print(); printf("B");} 13 }; 14 15 struct C : B { 16 typedef B superC; printC17 void print() {superC::print(); printf("C");} 18 }; 19 main()20int main () 21 { 22 A a; 23 B b; 24 C c; 25 26 a.print(); printf("\n"); 27 b.print(); printf("\n"); 28 c.print(); printf("\n"); 29 return 0; 30 } 31