* Fix #10200 False positive: uninitStructMember * Fix #9828 False positive: unreadVariable alias * Use Token::Match * Add test for #10398
This commit is contained in:
parent
cf6d30f358
commit
c132235a76
|
@ -178,6 +178,7 @@ private:
|
|||
TEST_CASE(localvarStruct10);
|
||||
TEST_CASE(localvarStruct11); // 10095
|
||||
TEST_CASE(localvarStruct12); // #10495
|
||||
TEST_CASE(localvarStruct13); // #10398
|
||||
TEST_CASE(localvarStructArray);
|
||||
TEST_CASE(localvarUnion1);
|
||||
|
||||
|
@ -4664,6 +4665,23 @@ private:
|
|||
ASSERT_EQUALS("", errout.str());
|
||||
}
|
||||
|
||||
void localvarStruct13() { // #10398
|
||||
functionVariableUsage("int f() {\n"
|
||||
" std::vector<std::string> Mode;\n"
|
||||
" Info Block = {\n"
|
||||
" {\n"
|
||||
" { &Mode },\n"
|
||||
" { &Level }\n"
|
||||
" }\n"
|
||||
" };\n"
|
||||
" Mode.resize(N);\n"
|
||||
" for (int i = 0; i < N; ++i)\n"
|
||||
" Mode[i] = \"abc\";\n"
|
||||
" return Save(&Block);\n"
|
||||
"}\n");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
}
|
||||
|
||||
void localvarStructArray() {
|
||||
// extracttests.start: struct X {int a;};
|
||||
|
||||
|
|
Loading…
Reference in New Issue