1// { dg-do compile } 2// { dg-options "-fno-ipa-cp" } 3struct data { 4 data(int) {} 5}; 6 7struct top { 8 virtual int topf() {} 9}; 10 11struct child1: top { 12 void childf() 13 { 14 data d(topf()); 15 } 16}; 17 18void test(top *t) 19{ 20 child1 *c = static_cast<child1 *>(t); 21 c->childf(); 22 child1 d; 23 test(&d); 24} 25