URL
https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk
Subversion Repositories openrisc_2011-10-31
[/] [openrisc/] [trunk/] [gnu-src/] [gcc-4.2.2/] [gcc/] [testsuite/] [g++.old-deja/] [g++.ns/] [alias6.C] - Rev 154
Compare with Previous | Blame | View Log
// { dg-do run }
// Check namespace aliases inside blocks
namespace A {
int i;
void f(){
i = 0;
}
}
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 {
int i = 1;
}
int g()
{
namespace x = A;
if (x::i)
{
namespace x = B;
return x::i;
}
return x::i;
}