Commit 5c77c924 authored by Eli Fidler's avatar Eli Fidler

with recent clang, this triggers -Wunevaluated-expression

specifically, "expression with side effects has no effect in an unevaluated context"
parent 03527109
......@@ -1119,14 +1119,18 @@ TEST(Value, ArrayHelperRangeFor) {
{
int i = 0;
for (auto& v : x.GetArray())
EXPECT_EQ(i++, v.GetInt());
for (auto& v : x.GetArray()) {
EXPECT_EQ(i, v.GetInt());
i++;
}
EXPECT_EQ(i, 10);
}
{
int i = 0;
for (const auto& v : const_cast<const Value&>(x).GetArray())
EXPECT_EQ(i++, v.GetInt());
for (const auto& v : const_cast<const Value&>(x).GetArray()) {
EXPECT_EQ(i, v.GetInt());
i++;
}
EXPECT_EQ(i, 10);
}
......
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