Skip to content

Commit

Permalink
minijail: Fix -Wrange-loop-construct warning.
Browse files Browse the repository at this point in the history
ToT clang is issuing following warnings:
loop variable 'profile' of type <snip> creates a copy from type
<snip> [-Werror,-Wrange-loop-construct]

Use reference type to silence the copy warning.

BUG=chromium:1055905
TEST=No more warning.

Change-Id: Iee9edebf07ed831b83d4360b1d3d8b803803ba83
  • Loading branch information
m-gupta committed Feb 25, 2020
1 parent 6f9654d commit 0bb824a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions minijail0_cli_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ TEST_F(CliTest, valid_logging) {
"syslog",
};

for (const auto profile : profiles) {
for (const auto& profile : profiles) {
argv[1] = profile;
ASSERT_TRUE(parse_args_(argv));
}
Expand Down Expand Up @@ -319,7 +319,7 @@ TEST_F(CliTest, valid_profile) {
"minimalistic-mountns-nodev",
};

for (const auto profile : profiles) {
for (const auto& profile : profiles) {
argv[1] = profile;
ASSERT_TRUE(parse_args_(argv));
}
Expand Down

0 comments on commit 0bb824a

Please sign in to comment.