FSF GCC merge 02/23/03
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.jason / opeq5.C
blob90996e9699869177514f5d96e9385e836bec8a3a
1 // Testcase for tricky synthesized op= in complex inheritance situation.
2 // This used to test whether the virtual base was copy-assigned only once.
3 // That feature is not required by ISO C++, so the test now only checks
4 // whether the vbase is assigned at all.
6 int count = 0;
7 extern "C" int printf (const char *, ...);
9 class A {
10  public:
11   A& operator = (const A&) { count++; return *this; }
14 class B: virtual private A { };
15 class C: virtual public A { };
16 class D: public B, public C { };
18 int main()
20   D a, b;
21   a = b;
22   printf ("%d\n",count);
23   if (count == 0)
24     return 1;
25   return 0;