summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.jason/opeq5.C
blob: 51b3e6e237caa130c8b89b20556c92e2349f53ab (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// Testcase for tricky synthesized op= in complex inheritance situation.
// See discussion in g++int.texi.

// execution test - XFAIL *-*-*

int count = 0;
extern "C" int printf (const char *, ...);

class A {
 public:
  A& operator = (const A&) { count++; return *this; }
};

class B: virtual private A { };
class C: virtual public A { };
class D: public B, public C { };

int main()
{
  D a, b;
  a = b;
  printf ("%d\n",count);
  if (count != 1)
    return 1;
  return 0;
}