1 // { dg-do run } 2 // prms-id: 2394 3 4 class Foo { 5 public: 6 int x; 7 int y; Foo(int i,int j)8 Foo(int i, int j) { x = i; y = j; } 9 } foo(10, 11); 10 11 class Wasted { int unsed; }; 12 13 class Bar : Wasted, public Foo { 14 public: Bar()15 Bar() : Foo(12, 13) { } 16 } bar; 17 18 int test0()19test0() { 20 int Foo::* pmi = &Foo::y; 21 return (int)(foo.*pmi); 22 } 23 24 int test1()25test1() { 26 int Foo::* pmi = &Foo::y; 27 return (int)(bar.*pmi); 28 } 29 30 int main()31main() { 32 if (test0() != 11) 33 return 1; 34 if (test1() != 13) 35 return 2; 36 return 0; 37 } 38