https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105672
--- Comment #3 from Jonathan Wakely <redi at gcc dot gnu.org> --- (In reply to Jonathan Wakely from comment #0) > Could we add a note for ill-formed conversions between two types that have > the same name, to make it more obvious that they're defined in different > scopes? > > Maybe: > > <error loc>:<col>: note: tuple and std::tuple are not the same type > <decl1 loc>:<col>: note: tuple define here > <decl2 loc>:<col>: note: std::tuple define here I *don't* want the locations printed for two different specializations of the same temploid, so e.g. don't show where foo<T>::bar and foo<U>::bar are declared. It will almost certainly be the same line, which won't help the confused user. I don't even think it's worth adding the first note that they're not the same type for two specializations of the same template. That's not the confusing case. I'm only suggesting this for two unrelated types that just happen to have the same name but are actually defined in totally different scopes, so a::foo and b::foo, or c::bar and ::bar. This would probably be useful for enumeration types as well as classes: namespace a { enum foo { } } namespace b { enum foo { B } } a::foo e = b::B;