struct A
{
static void foo() {}
};
namespace B
{
void bar() {}
}
void run()
{
A::A::A::A::A::A::A::A::A::A::A::A::A::A::A::A::A::A::A::A::A::A::A::A::A::A::A::A::A::foo(); // compiles
B::B::B::B::B::B::B::B::B::B::B::B::B::B::B::B::B::B::B::B::B::B::B::B::B::B::B::B::B::bar(); // doesn't compile
}
I'm intrigued by the fact that A::A::A...
is valid code. I would expect a compilation error just like I get for B::B::...
. Anything in the lookup rules that can explain that?