summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.old-deja/g++.jason/scoping4.C
blob: c32b4a66022fa519f844bf2c492ea2918a0045ea (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
// { dg-do assemble  }
// PRMS Id: 4375
// Bug: g++ fails to keep track of nested typedefs properly.

class A {
public:
  typedef const char * Ptr;
  Ptr s;
  Ptr get_string();
  A(Ptr string); // { s = string; };
};

class B {
public:
  typedef A * Ptr;
  Ptr a;
  Ptr get_A();
  B(Ptr a_ptr);
};

A::A(Ptr string) {		// { dg-bogus "" } 
  s = string;			// { dg-bogus "" } 
}

int main() {
  A a("testing");
  A *a_ptr;
  B b(&a);
  a_ptr = b.get_A();
}