2000-06-12 01:31:41 +00:00
|
|
|
namespace AAA {
|
|
|
|
char c;
|
|
|
|
int i;
|
|
|
|
int A_xyzq (int);
|
|
|
|
char xyzq (char);
|
|
|
|
class inA {
|
|
|
|
public:
|
|
|
|
int xx;
|
|
|
|
int fum (int);
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
int AAA::inA::fum (int i)
|
|
|
|
{
|
|
|
|
return 10 + i;
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace BBB {
|
|
|
|
char c;
|
|
|
|
int i;
|
|
|
|
int B_xyzq (int);
|
|
|
|
char xyzq (char);
|
|
|
|
|
|
|
|
namespace CCC {
|
|
|
|
char xyzq (char);
|
|
|
|
};
|
|
|
|
|
|
|
|
class Class {
|
|
|
|
public:
|
|
|
|
char xyzq (char);
|
|
|
|
int dummy;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
int AAA::A_xyzq (int x)
|
|
|
|
{
|
|
|
|
return 2 * x;
|
|
|
|
}
|
|
|
|
|
|
|
|
char AAA::xyzq (char c)
|
|
|
|
{
|
|
|
|
return 'a';
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int BBB::B_xyzq (int x)
|
|
|
|
{
|
|
|
|
return 3 * x;
|
|
|
|
}
|
|
|
|
|
|
|
|
char BBB::xyzq (char c)
|
|
|
|
{
|
|
|
|
return 'b';
|
|
|
|
}
|
|
|
|
|
|
|
|
char BBB::CCC::xyzq (char c)
|
|
|
|
{
|
|
|
|
return 'z';
|
|
|
|
}
|
|
|
|
|
|
|
|
char BBB::Class::xyzq (char c)
|
|
|
|
{
|
|
|
|
return 'o';
|
|
|
|
}
|
|
|
|
|
|
|
|
void marker1(void)
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
2003-05-20 03:56:29 +00:00
|
|
|
namespace
|
|
|
|
{
|
|
|
|
int X = 9;
|
|
|
|
|
|
|
|
namespace G
|
|
|
|
{
|
|
|
|
int Xg = 10;
|
2003-09-25 16:39:39 +00:00
|
|
|
|
|
|
|
namespace
|
|
|
|
{
|
|
|
|
int XgX = 11;
|
|
|
|
}
|
2003-05-20 03:56:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace C
|
|
|
|
{
|
|
|
|
int c = 1;
|
|
|
|
int shadow = 12;
|
|
|
|
|
|
|
|
namespace
|
|
|
|
{
|
|
|
|
int cX = 6;
|
|
|
|
|
|
|
|
namespace F
|
|
|
|
{
|
|
|
|
int cXf = 7;
|
2003-09-25 16:39:39 +00:00
|
|
|
|
|
|
|
namespace
|
|
|
|
{
|
|
|
|
int cXfX = 8;
|
|
|
|
}
|
2003-05-20 03:56:29 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
namespace C
|
|
|
|
{
|
|
|
|
int cc = 2;
|
|
|
|
}
|
|
|
|
|
2003-09-25 16:39:39 +00:00
|
|
|
namespace E
|
|
|
|
{
|
|
|
|
int ce = 4;
|
|
|
|
}
|
|
|
|
|
2003-05-20 03:56:29 +00:00
|
|
|
namespace D
|
|
|
|
{
|
|
|
|
int cd = 3;
|
|
|
|
int shadow = 13;
|
|
|
|
|
|
|
|
namespace E
|
|
|
|
{
|
|
|
|
int cde = 5;
|
|
|
|
}
|
|
|
|
|
|
|
|
void marker2 (void)
|
|
|
|
{
|
|
|
|
// NOTE: carlton/2003-04-23: I'm listing the expressions that I
|
|
|
|
// plan to have GDB try to print out, just to make sure that the
|
|
|
|
// compiler and I agree which ones should be legal! It's easy
|
|
|
|
// to screw up when testing the boundaries of namespace stuff.
|
|
|
|
c;
|
|
|
|
//cc;
|
|
|
|
C::cc;
|
|
|
|
cd;
|
2003-09-25 16:39:39 +00:00
|
|
|
//C::D::cd;
|
2003-05-20 03:56:29 +00:00
|
|
|
E::cde;
|
|
|
|
shadow;
|
2003-09-25 16:39:39 +00:00
|
|
|
//E::ce;
|
2003-05-20 03:56:29 +00:00
|
|
|
cX;
|
|
|
|
F::cXf;
|
2003-09-25 16:39:39 +00:00
|
|
|
F::cXfX;
|
2003-05-20 03:56:29 +00:00
|
|
|
X;
|
|
|
|
G::Xg;
|
|
|
|
//cXOtherFile;
|
|
|
|
//XOtherFile;
|
2003-09-25 16:39:39 +00:00
|
|
|
G::XgX;
|
2003-05-20 03:56:29 +00:00
|
|
|
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
2000-06-12 01:31:41 +00:00
|
|
|
|
|
|
|
int main ()
|
|
|
|
{
|
|
|
|
using AAA::inA;
|
|
|
|
char c1;
|
|
|
|
|
|
|
|
using namespace BBB;
|
|
|
|
|
|
|
|
c1 = xyzq ('x');
|
|
|
|
c1 = AAA::xyzq ('x');
|
|
|
|
c1 = BBB::CCC::xyzq ('m');
|
|
|
|
|
|
|
|
inA ina;
|
|
|
|
|
|
|
|
ina.xx = 33;
|
|
|
|
|
|
|
|
int y;
|
|
|
|
|
|
|
|
y = AAA::A_xyzq (33);
|
|
|
|
y += B_xyzq (44);
|
|
|
|
|
|
|
|
BBB::Class cl;
|
|
|
|
|
|
|
|
c1 = cl.xyzq('e');
|
|
|
|
|
|
|
|
marker1();
|
|
|
|
|
2003-05-20 03:56:29 +00:00
|
|
|
C::D::marker2 ();
|
2000-06-12 01:31:41 +00:00
|
|
|
}
|