Skip to content

Commit 1f0d5d8

Browse files
Update testother.cpp
1 parent 7edfff9 commit 1f0d5d8

1 file changed

Lines changed: 14 additions & 0 deletions

File tree

test/testother.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2026,6 +2026,20 @@ class TestOther : public TestFixture {
20262026
" }\n"
20272027
"}\n");
20282028
ASSERT_EQUALS("", errout_str());
2029+
2030+
check("void f(int& r) {\n" // #14566
2031+
" int i = 0;\n"
2032+
" while (g()) {\n"
2033+
" {\n"
2034+
" if (g()) {\n"
2035+
" i = 0;"
2036+
" std::swap(i, r);\n"
2037+
" }\n"
2038+
" }\n"
2039+
" }\n"
2040+
" use(i);"
2041+
"}\n");
2042+
ASSERT_EQUALS("", errout_str());
20292043
}
20302044

20312045
#define checkOldStylePointerCast(...) checkOldStylePointerCast_(__FILE__, __LINE__, __VA_ARGS__)

0 commit comments

Comments
 (0)