Here's the test case: --- typedef unsigned short ushort; namespace X { typedef unsigned short ushort; } using namespace X; int main() { ushort us = 0; } --- prompt> g++ main.cpp main.cpp: In function 'int main()': main.cpp:12: error: 'ushort' was not declared in this scope main.cpp:12: error: expected `;' before 'us' I'm expecting a clean compile (and it does compile cleanly with CW and Comeau). The deal is that the typedef ushort is defined in two different places, to the same type, and then brought "in conflict" via a using declaration. But since the two typedefs refer to the same type, I expect that the compiler will see that there is no conflict, and proceed without error or warning (reference C++03 7.1.3p2). Had the two typedefs referred to different types, I expect the compiler to complain about an ambiguity, for example: typedef unsigned short ushort; namespace X { typedef short ushort; } using namespace X; int main() { ushort us = 0; } error: ambiguous access to name found 'ushort' and 'X::ushort' This bug is important as client code commonly includes system headers which create a lot of common typedefs in the global namespace. If the user also (unknowingly) creates the same typedefs, and if there is no conflict, there should be no error. If there is a conflict, the error message should be a lot more helpful than it currently is.
This is a dup of bug 23594. *** This bug has been marked as a duplicate of 23594 ***