[clang-tools-extra] 7e2d27b - Fix two -Wrange-loop-analysis warnings that Xcode 12 beta incorrectly complains about
Nico Weber via cfe-commits
cfe-commits at lists.llvm.org
Sat Jul 4 17:42:29 PDT 2020
Author: Nico Weber
Date: 2020-07-04T20:41:33-04:00
New Revision: 7e2d27bc554eb607c90e55c89d2537f5d711234c
URL: https://github.com/llvm/llvm-project/commit/7e2d27bc554eb607c90e55c89d2537f5d711234c
DIFF: https://github.com/llvm/llvm-project/commit/7e2d27bc554eb607c90e55c89d2537f5d711234c.diff
LOG: Fix two -Wrange-loop-analysis warnings that Xcode 12 beta incorrectly complains about
Xcode 12 beta apparently has the Wrange-loop-analysis changes from
half a year ago, but it seems to lack https://reviews.llvm.org/D72212
which made the warning usable again.
Added:
Modified:
clang-tools-extra/clangd/XRefs.cpp
clang-tools-extra/clangd/unittests/PreambleTests.cpp
Removed:
################################################################################
diff --git a/clang-tools-extra/clangd/XRefs.cpp b/clang-tools-extra/clangd/XRefs.cpp
index 9b44edce95da..c208e953f2ab 100644
--- a/clang-tools-extra/clangd/XRefs.cpp
+++ b/clang-tools-extra/clangd/XRefs.cpp
@@ -1049,7 +1049,7 @@ ReferencesResult findReferences(ParsedAST &AST, Position Pos, uint32_t Limit,
const auto &IDToRefs = AST.getMacros().MacroRefs;
auto Refs = IDToRefs.find(*MacroSID);
if (Refs != IDToRefs.end()) {
- for (const auto Ref : Refs->second) {
+ for (const auto &Ref : Refs->second) {
Location Result;
Result.range = Ref;
Result.uri = URIMainFile;
diff --git a/clang-tools-extra/clangd/unittests/PreambleTests.cpp b/clang-tools-extra/clangd/unittests/PreambleTests.cpp
index 5bbcb292610e..8c9669a945dd 100644
--- a/clang-tools-extra/clangd/unittests/PreambleTests.cpp
+++ b/clang-tools-extra/clangd/unittests/PreambleTests.cpp
@@ -125,7 +125,7 @@ TEST(PreamblePatchTest, IncludeParsing) {
#/**/include <b.h>)cpp",
};
- for (const auto Case : Cases) {
+ for (const auto &Case : Cases) {
Annotations Test(Case);
const auto Code = Test.code();
SCOPED_TRACE(Code);
More information about the cfe-commits
mailing list