Index: lib/Parse/ParseStmt.cpp =================================================================== --- lib/Parse/ParseStmt.cpp +++ lib/Parse/ParseStmt.cpp @@ -183,7 +183,8 @@ // Look up the identifier, and typo-correct it to a keyword if it's not // found. - if (Next.isNot(tok::coloncolon)) { + if (Next.isNot(tok::coloncolon) && (!getLangOpts().MSVCCompat || + Next.isNot(tok::less))) { // Try to limit which sets of keywords should be included in typo // correction based on what the next token is. if (TryAnnotateName(/*IsAddressOfOperand*/ false, Index: test/SemaCXX/MicrosoftCompatibility.cpp =================================================================== --- test/SemaCXX/MicrosoftCompatibility.cpp +++ test/SemaCXX/MicrosoftCompatibility.cpp @@ -218,6 +218,9 @@ void function_missing_typename(const T::Type param)// expected-warning {{missing 'typename' prior to dependent type name}} { const T::Type var = 2; // expected-warning {{missing 'typename' prior to dependent type name}} + const A::TYPE var2 = 2; // expected-warning {{missing 'typename' prior to dependent type name}} + A::TYPE var3 = 2; // expected-warning {{missing 'typename' prior to dependent type name}} + MissingTypename::A::TYPE var4 = 2; // expected-warning {{missing 'typename' prior to dependent type name}} } template void function_missing_typename(const D::Type param);