summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.other/copy2.C
blob: c3e96e1030d426aa3727c842ed09d214d248d276 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
// { dg-do run  }
// Origin: Mark Mitchell <mark@codesourcery.com>

int i;

struct B {
  B () {}
  B (B&) { i = 1; }
  B (const B&) { i = 2; }
};

struct D : public B {
  D () {}
};

int main ()
{
  D d;
  D d2 (d);
  if (i != 2)
    return 1;
}