Sunday, November 12, 2006

Sick bugs, part 1

I'd really rather not reminisce on the sick and twisted path that led me to this one, so I'll just present it as is:

void bar() {}

namespace foo
{
using ::bar;
}

using namespace foo;
// namespace {}

int main(int argc, char * argv[])
{
bar();
return 0;
}

In VC6, the preceding block of code produces
error C2668: 'bar' : ambiguous call to overloaded function
and the error goes away when you uncomment "namespace {}". Yikes.

No comments:

Post a Comment