Index: lib/AST/ASTDiagnostic.cpp =================================================================== --- lib/AST/ASTDiagnostic.cpp +++ lib/AST/ASTDiagnostic.cpp @@ -420,6 +420,8 @@ OS << ConvertTypeToDiagnosticString(Context, Context.getTypeDeclType(Type), PrevArgs, QualTypeVals); + } else if (const auto *LS = dyn_cast(DC)) { + OS << "linkage specification"; } else { assert(isa(DC) && "Expected a NamedDecl"); NamedDecl *ND = cast(DC); Index: test/SemaCXX/warn-shadow.cpp =================================================================== --- test/SemaCXX/warn-shadow.cpp +++ test/SemaCXX/warn-shadow.cpp @@ -206,3 +206,10 @@ } } + +extern "C" { +typedef int externC; // expected-note {{previous declaration is here}} +} +void handleLinkageSpec() { + typedef void externC; // expected-warning {{declaration shadows a typedef in linkage specification}} +}