Commit 926c69c1 authored by Nico Weber's avatar Nico Weber Committed by Commit Bot

Enable -Wrange-loop-analysis.

The code might now compile with it on.

TBR=martinkr@google.com

Bug: 1039697
Change-Id: I1eaaa9ad5bcf0365d61ac7959e24c77e84df0b41
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2067150
Commit-Queue: Nico Weber <thakis@chromium.org>
Auto-Submit: Nico Weber <thakis@chromium.org>
Reviewed-by: default avatarHans Wennborg <hans@chromium.org>
Cr-Commit-Position: refs/heads/master@{#745535}
parent 7428644b
......@@ -1523,9 +1523,6 @@ config("default_warnings") {
# TODO(https://crbug.com/1028110): Evaluate and possible enable.
"-Wno-deprecated-copy",
# TODO(https://crbug.com/1039697): Evaluate and possibly enable.
"-Wno-range-loop-analysis",
# TODO(https://crbug.com/1050281): Clean up, enable.
"-Wno-non-c-typedef-for-linkage",
]
......
......@@ -352,7 +352,7 @@ std::vector<base::FilePath> SharedSampler::GetSupportedImageNames() {
bool SharedSampler::IsSupportedImageName(
base::FilePath::StringPieceType image_name) const {
for (const base::FilePath supported_name : supported_image_names_) {
for (const base::FilePath& supported_name : supported_image_names_) {
if (base::FilePath::CompareEqualIgnoreCase(image_name,
supported_name.value()))
return true;
......
......@@ -640,7 +640,8 @@ void MainController::LogsUploadComplete(const base::string16& tag,
it->second = true;
if (quit_when_logs_upload_complete_) {
for (const std::pair<base::string16, bool>& entry : logs_upload_complete_) {
for (const std::pair<const base::string16, bool>& entry :
logs_upload_complete_) {
if (!entry.second) {
LOG(INFO) << "Waiting for the upload of logs with tag \"" << entry.first
<< "\" to complete before exiting";
......
......@@ -243,7 +243,7 @@ TEST_F(QuarantineWinTest, UnsafeReferrer_DependsOnLocalConfig) {
huge_referrer.append(INTERNET_MAX_URL_LENGTH * 2, 'a');
unsafe_referrers.push_back(huge_referrer);
for (const auto referrer_url : unsafe_referrers) {
for (const auto& referrer_url : unsafe_referrers) {
SCOPED_TRACE(::testing::Message() << "Trying URL " << referrer_url);
ASSERT_TRUE(CreateFile(test_file));
......
......@@ -87,7 +87,7 @@ TEST(TypeConversionsTest, ToAuthenticatorMakeCredentialResponse) {
false},
};
size_t i = 0;
for (const auto test : test_cases) {
for (const auto& test : test_cases) {
SCOPED_TRACE(::testing::Message() << "Test case " << i++);
auto response =
ToAuthenticatorMakeCredentialResponse(WEBAUTHN_CREDENTIAL_ATTESTATION{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment