2003-12-26 Guilhem Lavaux <guilhem@kaffe.org>
[official-gcc.git] / gcc / testsuite / g++.old-deja / g++.law / copy1.C
blob46e53c785532e448d6286f57f48f615ab51daf37
1 // { dg-do run  }
2 // GROUPS passed copy-ctors
3 #include <stdio.h>
5 int pass = 0;
6 class name {
7   int namestuff;
8 public:
9   name() {
10     namestuff = 111;
11   }
12   name(const name& subject);
13   
14   name & operator = (const name& right) {
15     this->namestuff = right.namestuff;
16     return *this;
17   }
18   
19   ~name() {
20     ;
21   }
24 name::name(const name& subject) {
25     pass = 1;
28 class person {
29   int personstuff;
30   name personname;
31 public:
32   person() {
33     ;
34     personstuff = 222;
35   }
36   ~person() {
37     ;
38   }     
39   void print() {
40     ;
41   }
42   
45 void
46 test(person argp)
48   person testp;
49   
50   ;
51   argp.print();
52   testp = argp;
53   argp.print();
54   testp.print();
55   ;
58 int main()
60   person mainp;
61   test(mainp);
62   if (pass)
63     printf ("PASS\n");
64   else
65     { printf ("FAIL\n"); return 1; }