1 // { dg-do run } 2 void *vp; 3 4 class silly { 5 public: b()6 virtual int b() { return 1; } 7 }; 8 class solly : silly { 9 public: b()10 virtual int b() { return 2; } 11 }; 12 class thing { 13 public: a()14 virtual int a() { return 3; } 15 }; 16 class thong : public solly, public thing { 17 public: a()18 virtual int a() { 19 if (this != vp) return 4; 20 else return 0; 21 } 22 }; 23 24 typedef int(thing::*ping)(); 25 ping qq = &thing::a; 26 main()27int main() { 28 thong b; 29 vp = &b; 30 return (b.*qq)(); 31 } 32