Index: lib/AST/ASTDumper.cpp =================================================================== --- lib/AST/ASTDumper.cpp +++ lib/AST/ASTDumper.cpp @@ -359,13 +359,6 @@ for (auto *D : (Deserialize ? DC->decls() : DC->noload_decls())) dumpDecl(D); - - if (DC->hasExternalLexicalStorage()) { - dumpChild([=] { - ColorScope Color(OS, ShowColors, UndeserializedColor); - OS << ""; - }); - } } void ASTDumper::dumpLookups(const DeclContext *DC, bool DumpDecls) { Index: lib/AST/TextNodeDumper.cpp =================================================================== --- lib/AST/TextNodeDumper.cpp +++ lib/AST/TextNodeDumper.cpp @@ -255,6 +255,17 @@ if (const FunctionDecl *FD = dyn_cast(D)) if (FD->isConstexpr()) OS << " constexpr"; + + if (!isa(*D)) { + const auto *MD = dyn_cast(D); + if (!MD || !MD->isThisDeclarationADefinition()) { + const auto *DC = dyn_cast(D); + if (DC && DC->hasExternalLexicalStorage()) { + ColorScope Color(OS, ShowColors, UndeserializedColor); + OS << " "; + } + } + } } void TextNodeDumper::Visit(const CXXCtorInitializer *Init) { Index: test/AST/ast-dump-undeserialized.cpp =================================================================== --- test/AST/ast-dump-undeserialized.cpp +++ test/AST/ast-dump-undeserialized.cpp @@ -1,4 +1,3 @@ // RUN: %clang_cc1 %s -chain-include %s -ast-dump | FileCheck -strict-whitespace %s -// CHECK: TranslationUnitDecl 0x{{.+}} <> -// CHECK: `- +// CHECK: TranslationUnitDecl 0x{{.+}} <>