1217309Snwhitehorn// { dg-do run } 2251843Sbapt// Testcase for tricky synthesized op= in complex inheritance situation. 3217309Snwhitehorn// This used to test whether the virtual base was copy-assigned only once. 4220749Snwhitehorn// That feature is not required by ISO C++, so the test now only checks 5217309Snwhitehorn// whether the vbase is assigned at all. 6251843Sbapt 7217309Snwhitehornint count = 0; 8217309Snwhitehornextern "C" int printf (const char *, ...); 9217309Snwhitehorn 10217309Snwhitehornclass A { 11217309Snwhitehorn public: 12217309Snwhitehorn A& operator = (const A&) { count++; return *this; } 13217309Snwhitehorn}; 14217309Snwhitehorn 15217309Snwhitehornclass B: virtual private A { }; 16217309Snwhitehornclass C: virtual public A { }; 17217309Snwhitehornclass D: public B, public C { }; 18217309Snwhitehorn 19217309Snwhitehornint main() 20217309Snwhitehorn{ 21217309Snwhitehorn D a, b; 22217309Snwhitehorn a = b; 23217309Snwhitehorn printf ("%d\n",count); 24217309Snwhitehorn if (count == 0) 25217309Snwhitehorn return 1; 26217309Snwhitehorn return 0; 27217309Snwhitehorn} 28217309Snwhitehorn