OpenCores
URL https://opencores.org/ocsvn/openrisc/openrisc/trunk

Subversion Repositories openrisc

[/] [openrisc/] [tags/] [gnu-src/] [gcc-4.5.1/] [gcc-4.5.1-or32-1.0rc1/] [gcc/] [testsuite/] [g++.old-deja/] [g++.law/] [copy1.C] - Blame information for rev 305

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 305 jeremybenn
// { dg-do run  }
2
// GROUPS passed copy-ctors
3
#include 
4
 
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
  }
22
};
23
 
24
name::name(const name& subject) {
25
    pass = 1;
26
}
27
 
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
 
43
};
44
 
45
void
46
test(person argp)
47
{
48
  person testp;
49
 
50
  ;
51
  argp.print();
52
  testp = argp;
53
  argp.print();
54
  testp.print();
55
  ;
56
}
57
 
58
int main()
59
{
60
  person mainp;
61
  test(mainp);
62
  if (pass)
63
    printf ("PASS\n");
64
  else
65
    { printf ("FAIL\n"); return 1; }
66
}
67
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.