From 72b3855bf58702b3731d74f8eb24f8c5dfb150d8 Mon Sep 17 00:00:00 2001 From: Eric Liu Date: Tue, 9 Jan 2018 20:26:49 +0000 Subject: [PATCH] Try to fix build failure caused by r322097 Avoid mapping during output when Detail is nullptr; otherwise, an empty "Detail" field will be populated in YAML output. llvm-svn: 322116 --- clang-tools-extra/clangd/index/SymbolYAML.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/clang-tools-extra/clangd/index/SymbolYAML.cpp b/clang-tools-extra/clangd/index/SymbolYAML.cpp index 295b2207ca01..8a58a6dfb8a6 100644 --- a/clang-tools-extra/clangd/index/SymbolYAML.cpp +++ b/clang-tools-extra/clangd/index/SymbolYAML.cpp @@ -92,7 +92,8 @@ template <> struct MappingTraits { IO.mapOptional("CompletionSnippetInsertText", Sym.CompletionSnippetInsertText); - IO.mapOptional("Detail", Sym.Detail); + if (!IO.outputting() || Sym.Detail) + IO.mapOptional("Detail", Sym.Detail); } };