1 // { dg-do run } 2 // Based on a test case by Andrew Bell <andrew.bell@bigfoot.com> 3 // Check for pointer-to-virtual-function calls on 4 // bases without virtual functions. 5 6 struct B{}; 7 8 struct D: public B{ 9 virtual void foo(); 10 }; 11 foo()12void D::foo(){} 13 main()14int main() 15 { 16 B *b = new D; 17 void (B::*f)() = static_cast<void (B::*)()>(&D::foo); 18 (b->*f)(); 19 } 20