Skip to content

Commit 25756ad

Browse files
committed
add test
1 parent 8effc6c commit 25756ad

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

test/testother.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4155,6 +4155,17 @@ class TestOther : public TestFixture {
41554155
" return r;\n"
41564156
"}\n");
41574157
ASSERT_EQUALS("", errout_str());
4158+
4159+
check("struct Item { int state; };\n"
4160+
"void foo(std::vector<Item> &items) {\n"
4161+
" for (auto &item : items) {\n"
4162+
" switch (auto &s = item.state) {\n"
4163+
" case 0: s = 1; break;\n"
4164+
" default: break;\n"
4165+
" }\n"
4166+
" }\n"
4167+
"}\n");
4168+
ASSERT_EQUALS("", errout_str());
41584169
}
41594170

41604171
void constParameterCallback() {

0 commit comments

Comments
 (0)