summaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.cp/pr-1553.cc
blob: 58441fdb80f4b3a73e3730df14c81272bb05c167 (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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
class A {
public:
  class B;
  class C;
};

class A::B {
  int a_b;

public:
  C* get_c(int i);
};

class A::C
{
  int a_c;
};

class E {
public:
  class F;
};
 
class E::F {
public:
  int e_f;
 
  F& operator=(const F &other);
};

void refer_to (E::F *f) {
  // Do nothing.
}

void refer_to (A::C **ref) {
  // Do nothing.  But, while we're at it, force out debug info for
  // A::B and E::F.

  A::B b;
  E::F f;

  refer_to (&f);
}

int main () {
  A::C* c_var;
  A::B* b_var;
  E *e_var;

  // Keep around a reference so that GCC 3.4 doesn't optimize the variable
  // away.
  refer_to (&c_var);
}