namespace ns1 {
typedef unsigned long ns_t;
struct base
{
~base() {}
};
}
namespace ns2 {
using namespace ns1;
struct dummy : public base
{
};
}
namespace ns3 {
struct dummy2
{
dummy2() {}
ns2::dummy m_dummy;
};
}
ns_t ns_check; //compilation should fail here!!
The above code compiles fine on my machine. The problem is that , for some reason, ns_t is visible at the global namespace when it shouldn't be. Strangely, removing base::~base will cause the behavior I expect (compilation error).
I'm not sure exactly where the bug is and what a workaround might be. If someone from the VC team can reproduce this, I'd appreicate some information on how to avoid triggering the behavior.