OSDN Git Service
(root)
/
pf3gnuchains
/
gcc-fork.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
gcc/
[pf3gnuchains/gcc-fork.git]
/
gcc
/
testsuite
/
g++.old-deja
/
g++.ns
/
alias6.C
1
// { dg-do run }
2
// Check namespace aliases inside blocks
3
namespace A {
4
int i;
5
void f(){
6
i = 0;
7
}
8
}
9
10
int g();
11
12
int main ()
13
{
14
namespace B = A;
15
B::i=42;
16
B::f();
17
using namespace B;
18
f();
19
// A::i is now 0, B::i is 1
20
return g();
21
}
22
23
namespace B {
24
int i = 1;
25
}
26
27
int g()
28
{
29
namespace x = A;
30
if (x::i)
31
{
32
namespace x = B;
33
return x::i;
34
}
35
return x::i;
36
}