Author: Tres Popp Date: 2020-06-26T10:12:04+02:00 New Revision: 1a30eab413cefb18e733ef6aec42dc04a4a76592
URL: https://github.com/llvm/llvm-project/commit/1a30eab413cefb18e733ef6aec42dc04a4a76592 DIFF: https://github.com/llvm/llvm-project/commit/1a30eab413cefb18e733ef6aec42dc04a4a76592.diff LOG: Prevent unused error when assertions are disabled. Added: Modified: clang-tools-extra/clangd/ConfigYAML.cpp Removed: ################################################################################ diff --git a/clang-tools-extra/clangd/ConfigYAML.cpp b/clang-tools-extra/clangd/ConfigYAML.cpp index ee3331df8694..8575356132ca 100644 --- a/clang-tools-extra/clangd/ConfigYAML.cpp +++ b/clang-tools-extra/clangd/ConfigYAML.cpp @@ -80,8 +80,10 @@ class Parser { // 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<bool(Node &)> 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)); } _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits