From 1a30eab413cefb18e733ef6aec42dc04a4a76592 Mon Sep 17 00:00:00 2001 From: Tres Popp Date: Fri, 26 Jun 2020 10:12:04 +0200 Subject: [PATCH] Prevent unused error when assertions are disabled. --- clang-tools-extra/clangd/ConfigYAML.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/clang-tools-extra/clangd/ConfigYAML.cpp b/clang-tools-extra/clangd/ConfigYAML.cpp index ee3331d..8575356 100644 --- a/clang-tools-extra/clangd/ConfigYAML.cpp +++ b/clang-tools-extra/clangd/ConfigYAML.cpp @@ -80,8 +80,10 @@ private: // It should emit diagnostics if the value is invalid (e.g. wrong type). // If Key is seen twice, Parse runs only once and an error is reported. void handle(llvm::StringLiteral Key, std::function Parse) { - for (const auto &Entry : Keys) + for (const auto &Entry : Keys) { + (void) Entry; assert(Entry.first != Key && "duplicate key handler"); + } Keys.emplace_back(Key, std::move(Parse)); } -- 2.7.4