aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.cp/namespace-using.cc
blob: 4786fd5521eea5ca9fa0ec2968e6dd00b03f7b17 (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
namespace A
{
  int _a = 1;
  int x = 2;
}

int marker4(){
	using A::x;
	return 0;
}

int marker3(){
	return marker4();
}

int marker2()
{
  namespace B = A;
  B::_a;
  return marker3();
}

int marker1()
{
  int total = 0;
  {
    int b = 1;
    {
      using namespace A;
      int c = 2;
      {
        int d = 3;
        total = _a + b + c + d + marker2(); // marker1 stop
      }
    }
  }
  return total;
}

int main()
{
  using namespace A;
  _a;
  return marker1();
}