projects
/
gcc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2077e86
)
Add aliases in nested blocks
author
Martin v. Löwis
<loewis@gcc.gnu.org>
Wed, 15 Jul 1998 14:38:06 +0000
(14:38 +0000)
committer
Martin v. Löwis
<loewis@gcc.gnu.org>
Wed, 15 Jul 1998 14:38:06 +0000
(14:38 +0000)
From-SVN: r21197
gcc/testsuite/g++.old-deja/g++.ns/alias6.C
patch
|
blob
|
history
diff --git
a/gcc/testsuite/g++.old-deja/g++.ns/alias6.C
b/gcc/testsuite/g++.old-deja/g++.ns/alias6.C
index 130d51ece0f1274990e0d6ebf93a8167ff9354de..b0799abf775823d20950b44b4df6c8410201cb7c 100644
(file)
--- a/
gcc/testsuite/g++.old-deja/g++.ns/alias6.C
+++ b/
gcc/testsuite/g++.old-deja/g++.ns/alias6.C
@@
-1,16
+1,35
@@
+// Check namespace aliases inside blocks
namespace A {
int i;
- void f(){}
+ void f(){
+ i = 0;
+ }
}
-main ()
+int g();
+
+int main ()
{
namespace B = A;
B::i=42;
B::f();
using namespace B;
f();
+ // A::i is now 0, B::i is 1
+ return g();
}
-namespace B {}
+namespace B {
+ int i = 1;
+}
+int g()
+{
+ namespace x = A;
+ if (x::i)
+ {
+ namespace x = B;
+ return x::i;
+ }
+ return x::i;
+}