http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52379
Bug #: 52379 Summary: When inheriting a class X from another namespace, inside the class X will always refer to that one. Classification: Unclassified Product: gcc Version: 4.6.2 Status: UNCONFIRMED Severity: major Priority: P3 Component: c++ AssignedTo: unassig...@gcc.gnu.org ReportedBy: y...@jormy.com The attached code should compile, but it does not. GCC thinks "a" inside Two::B::B() refers to One::A, but it should actually be Two::A instead. Making Two::B not inherit from One::A removes the problem, so it seems to be related to inheritance. If there was class C in namespace One, having the object "C a" inside B::B() will not work on both cases, so it seems to be only affecting that specific class name. thanks to _verty for testing this on 4.6.2 as well, but it existed in 4.3.4 as well (ideone link : http://ideone.com/TpmpM)