summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.brendan/copy7.C
blob: 8fbec3384ac77179146bd9b268a500ca4fa7ece3 (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
27
28
29
30
31
// { dg-do run  }
// GROUPS passed copy-ctors
extern "C" int printf (const char *, ...);
extern "C" void exit (int);

void die () { printf ("FAIL\n"); exit (1); }

class B {
public:
  B() {}
  B(const B &) { printf ("PASS\n"); exit (0); }
private:
    int x;
};

class A : public B {
public:
    A() {}

  A(const B &) { printf ("FAIL\n"); exit (1); }
};

int
main()
{
    A a;
    A b(a);

    printf ("FAIL\n");
    return 1;
}