]>
Commit | Line | Data |
---|---|---|
66a55e80 DB |
1 | namespace AAA { |
2 | char c; | |
3 | int i; | |
4 | int A_xyzq (int); | |
5 | char xyzq (char); | |
6 | class inA { | |
7 | public: | |
8 | int xx; | |
9 | int fum (int); | |
10 | }; | |
11 | }; | |
12 | ||
13 | int AAA::inA::fum (int i) | |
14 | { | |
15 | return 10 + i; | |
16 | } | |
17 | ||
18 | namespace BBB { | |
19 | char c; | |
20 | int i; | |
21 | int B_xyzq (int); | |
22 | char xyzq (char); | |
23 | ||
24 | namespace CCC { | |
25 | char xyzq (char); | |
26 | }; | |
27 | ||
28 | class Class { | |
29 | public: | |
30 | char xyzq (char); | |
31 | int dummy; | |
32 | }; | |
33 | }; | |
34 | ||
35 | int AAA::A_xyzq (int x) | |
36 | { | |
37 | return 2 * x; | |
38 | } | |
39 | ||
40 | char AAA::xyzq (char c) | |
41 | { | |
42 | return 'a'; | |
43 | } | |
44 | ||
45 | ||
46 | int BBB::B_xyzq (int x) | |
47 | { | |
48 | return 3 * x; | |
49 | } | |
50 | ||
51 | char BBB::xyzq (char c) | |
52 | { | |
53 | return 'b'; | |
54 | } | |
55 | ||
56 | char BBB::CCC::xyzq (char c) | |
57 | { | |
58 | return 'z'; | |
59 | } | |
60 | ||
61 | char BBB::Class::xyzq (char c) | |
62 | { | |
63 | return 'o'; | |
64 | } | |
65 | ||
66 | void marker1(void) | |
67 | { | |
68 | return; | |
69 | } | |
70 | ||
1fcb5155 DC |
71 | namespace |
72 | { | |
73 | int X = 9; | |
74 | ||
75 | namespace G | |
76 | { | |
77 | int Xg = 10; | |
79c2c32d DC |
78 | |
79 | namespace | |
80 | { | |
81 | int XgX = 11; | |
82 | } | |
1fcb5155 DC |
83 | } |
84 | } | |
85 | ||
86 | namespace C | |
87 | { | |
88 | int c = 1; | |
89 | int shadow = 12; | |
90 | ||
91 | namespace | |
92 | { | |
93 | int cX = 6; | |
94 | ||
95 | namespace F | |
96 | { | |
97 | int cXf = 7; | |
79c2c32d DC |
98 | |
99 | namespace | |
100 | { | |
101 | int cXfX = 8; | |
102 | } | |
1fcb5155 DC |
103 | } |
104 | } | |
105 | ||
106 | namespace C | |
107 | { | |
108 | int cc = 2; | |
109 | } | |
110 | ||
79c2c32d DC |
111 | namespace E |
112 | { | |
113 | int ce = 4; | |
114 | } | |
115 | ||
1fcb5155 DC |
116 | namespace D |
117 | { | |
118 | int cd = 3; | |
119 | int shadow = 13; | |
120 | ||
121 | namespace E | |
122 | { | |
123 | int cde = 5; | |
124 | } | |
125 | ||
126 | void marker2 (void) | |
127 | { | |
128 | // NOTE: carlton/2003-04-23: I'm listing the expressions that I | |
129 | // plan to have GDB try to print out, just to make sure that the | |
130 | // compiler and I agree which ones should be legal! It's easy | |
131 | // to screw up when testing the boundaries of namespace stuff. | |
132 | c; | |
133 | //cc; | |
134 | C::cc; | |
135 | cd; | |
79c2c32d | 136 | //C::D::cd; |
1fcb5155 DC |
137 | E::cde; |
138 | shadow; | |
79c2c32d | 139 | //E::ce; |
1fcb5155 DC |
140 | cX; |
141 | F::cXf; | |
79c2c32d | 142 | F::cXfX; |
1fcb5155 DC |
143 | X; |
144 | G::Xg; | |
145 | //cXOtherFile; | |
146 | //XOtherFile; | |
79c2c32d | 147 | G::XgX; |
1fcb5155 DC |
148 | |
149 | return; | |
150 | } | |
151 | ||
152 | } | |
153 | } | |
66a55e80 DB |
154 | |
155 | int main () | |
156 | { | |
157 | using AAA::inA; | |
158 | char c1; | |
159 | ||
160 | using namespace BBB; | |
161 | ||
162 | c1 = xyzq ('x'); | |
163 | c1 = AAA::xyzq ('x'); | |
164 | c1 = BBB::CCC::xyzq ('m'); | |
165 | ||
166 | inA ina; | |
167 | ||
168 | ina.xx = 33; | |
169 | ||
170 | int y; | |
171 | ||
172 | y = AAA::A_xyzq (33); | |
173 | y += B_xyzq (44); | |
174 | ||
175 | BBB::Class cl; | |
176 | ||
177 | c1 = cl.xyzq('e'); | |
178 | ||
179 | marker1(); | |
180 | ||
1fcb5155 | 181 | C::D::marker2 (); |
66a55e80 | 182 | } |