aboutsummaryrefslogtreecommitdiff
path: root/gdb/testsuite/gdb.cp/nsusing.cc
blob: b1f0ce48c9bee85e1a1876806d5268694b262d89 (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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
namespace O
{
  int ox = 4;
}

namespace PQ
{
  int marker6 ()
  {
    return 0;
  }
}

namespace P
{
  using namespace O;
}

//--------------
namespace C
{
  int cc = 3;
}

using namespace C;
int marker5 ()
{
  cc;
  return PQ::marker6 ();
}


namespace A
{
  int _a = 1;
  int x = 2;
}

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

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 marker2() + total;
}

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