Index: lib/Sema/SemaDecl.cpp =================================================================== --- lib/Sema/SemaDecl.cpp +++ lib/Sema/SemaDecl.cpp @@ -6742,6 +6742,10 @@ /// if it doesn't shadow any declaration or shadowing warnings are disabled. NamedDecl *Sema::getShadowedDeclaration(const TypedefNameDecl *D, const LookupResult &R) { + // Don't warn if typedef declaration is part of a class + if (D->getDeclContext()->isRecord()) + return nullptr; + if (!shouldWarnIfShadowedDecl(Diags, R)) return nullptr; Index: test/SemaCXX/warn-shadow.cpp =================================================================== --- test/SemaCXX/warn-shadow.cpp +++ test/SemaCXX/warn-shadow.cpp @@ -87,6 +87,16 @@ } }; +struct path { + using value_type = char; + typedef char value_type2; + struct iterator { + using value_type = path; // no warning + typedef path value_type2; // no warning + }; +}; + + // TODO: this should warn, class B : A { int data;