mirror of
https://github.com/Tencent/rapidjson.git
synced 2025-10-28 03:20:15 +01:00
with recent clang, this triggers -Wunevaluated-expression
specifically, "expression with side effects has no effect in an unevaluated context"
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user