summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.mike/p9732a.C
blob: 9af5a9002f89f79c69f7086bd123145679378158 (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
32
33
34
35
36
37
// { dg-do run  }
// prms-id: 9732

class A {
  int i;
public:
  A() { i = 1; }
  ~A() { }
};

struct value {
  A x,y,z;
};

int crash(const value* capt, value* jet) {
  return capt == jet;
}

class euler {
public:
  value number() const { return _value; }
  int distance();

private:
  value _value;
};

int euler::distance() {
  const value& capt = number();
  value jet;
  return crash (&capt, &jet);
}

int main() {
  euler e;
  return e.distance();
}