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.
This commit is contained in:
Nico Weber 2020-07-04 20:41:27 -04:00
parent 90a35bd074
commit 7e2d27bc55
2 changed files with 2 additions and 2 deletions

View File

@ -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;

View File

@ -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);