repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
FSF GCC merge 02/23/03
[official-gcc.git]
/
gcc
/
testsuite
/
g++.old-deja
/
g++.ns
/
alias6.C
blob
b0799abf775823d20950b44b4df6c8410201cb7c
1
// Check namespace aliases inside blocks
2
namespace A {
3
int i;
4
void f(){
5
i = 0;
6
}
7
}
8
9
int g();
10
11
int main ()
12
{
13
namespace B = A;
14
B::i=42;
15
B::f();
16
using namespace B;
17
f();
18
// A::i is now 0, B::i is 1
19
return g();
20
}
21
22
namespace B {
23
int i = 1;
24
}
25
26
int g()
27
{
28
namespace x = A;
29
if (x::i)
30
{
31
namespace x = B;
32
return x::i;
33
}
34
return x::i;
35
}