namespace A
{
namespace B
{
struct base {
void x() {}
void y() {}
};
}
struct member
{
void foo();
};
struct middleman
{
member * operator->() { return 0; }
};
struct sub : B::base
{
void x() {}
middleman operator->() { return middleman(); }
};
}
struct bad
{
int x();
};
namespace C
{
void fun()
{
A::sub a;
a.x();
a.sub::x();
a.base::x();
a.B::base::x();
a.A::sub::x();
a.A::B::base::x();
a.bad::x();
a->foo();
a->member::foo();
a->A::member::foo();
}
void fun2()
{
A::sub *a;
a->x();
a->sub::x();
a->base::x();
a->B::base::x();
a->A::sub::x();
a->A::B::base::x();
a->bad::x();
(*a)->foo();
(*a)->member::foo();
(*a)->A::member::foo();
}
void fun3()
{
int i;
i.foo(); }
void fun4a() {
A::sub *a;
typedef A::member base; a->base::x(); }
void fun4b() {
A::sub *a;
typedef A::B::base base;
a->base::x();
}
template<typename T>
void fun5()
{
T a;
a.x();
a->foo();
a.A::sub::x();
a.A::B::base::x();
a->A::member::foo();
a.bad::x(); }
void test_fun5() {
fun5<A::sub>(); }
template<typename T>
void fun6() {
T a;
a.sub::x();
a.base::x();
a->member::foo();
a.B::base::x(); }
void test_fun6() {
fun6<A::sub>(); }
}
struct a {
int a;
static int sa;
};
a a;
int a::sa = a.a;
namespace PR6645 {
typedef int foo;
namespace Inner {
typedef int PR6645::foo; }
}