* Add test for #9327

* Add test for #10597
This commit is contained in:
chrchr-github 2022-10-25 19:41:48 +02:00 committed by GitHub
parent 4634a72fe0
commit 3b5601dbea
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 2 deletions

View File

@ -4448,6 +4448,15 @@ private:
" *n == 'A');\n"
"}\n");
ASSERT_EQUALS("", errout.str());
check("void f(std::istringstream& i) {\n" // #9327
" std::string s;\n"
" if (!(i >> s))\n"
" return;\n"
" if (!(i >> s))\n"
" return;\n"
"}\n");
ASSERT_EQUALS("", errout.str());
}
void alwaysTrueSymbolic()

View File

@ -3506,14 +3506,20 @@ private:
ASSERT_EQUALS("", errout.str());
}
void localvar60() { // #10531
functionVariableUsage("void Scale(double scale) {\n"
void localvar60() {
functionVariableUsage("void Scale(double scale) {\n" // #10531
" for (int i = 0; i < m_points.size(); ++i) {\n"
" auto& p = m_points[i];\n"
" p += scale;\n"
" }\n"
"}");
ASSERT_EQUALS("", errout.str());
functionVariableUsage("void foo(int c[]) {\n" // #10597
" int& cc = c[0];\n"
" cc &= ~0xff;\n"
"}\n");
ASSERT_EQUALS("", errout.str());
}
void localvar61() { // #9407