Merge branch 'master' of https://github.com/danmar/cppcheck
This commit is contained in:
commit
7002f9df35
|
@ -2792,7 +2792,7 @@ void Tokenizer::setVarId()
|
||||||
|
|
||||||
const Token* tokStart = tok->tokAt(2);
|
const Token* tokStart = tok->tokAt(2);
|
||||||
while (tokStart && tokStart->str() != "{") {
|
while (tokStart && tokStart->str() != "{") {
|
||||||
if (Token::Match(tokStart, "public|private|protected"))
|
if (Token::Match(tokStart, "public|private|protected %name%"))
|
||||||
tokStart = tokStart->next();
|
tokStart = tokStart->next();
|
||||||
if (tokStart->strAt(1) == "," || tokStart->strAt(1) == "{")
|
if (tokStart->strAt(1) == "," || tokStart->strAt(1) == "{")
|
||||||
varlist[classname].insert(varlist[tokStart->str()].begin(), varlist[tokStart->str()].end());
|
varlist[classname].insert(varlist[tokStart->str()].begin(), varlist[tokStart->str()].end());
|
||||||
|
|
|
@ -82,6 +82,7 @@ private:
|
||||||
TEST_CASE(garbageCode41); // #6685
|
TEST_CASE(garbageCode41); // #6685
|
||||||
TEST_CASE(garbageCode42); // #5760
|
TEST_CASE(garbageCode42); // #5760
|
||||||
TEST_CASE(garbageCode43); // #6703
|
TEST_CASE(garbageCode43); // #6703
|
||||||
|
TEST_CASE(garbageCode44); // #6704
|
||||||
|
|
||||||
TEST_CASE(garbageValueFlow);
|
TEST_CASE(garbageValueFlow);
|
||||||
TEST_CASE(garbageSymbolDatabase);
|
TEST_CASE(garbageSymbolDatabase);
|
||||||
|
@ -475,6 +476,10 @@ private:
|
||||||
checkCode("int { }; struct A<void> a = { }");
|
checkCode("int { }; struct A<void> a = { }");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void garbageCode44() { // #6704
|
||||||
|
ASSERT_THROW(checkCode("{ { }; }; { class A : }; public typedef b;"), InternalError);
|
||||||
|
}
|
||||||
|
|
||||||
void garbageValueFlow() {
|
void garbageValueFlow() {
|
||||||
// #6089
|
// #6089
|
||||||
const char* code = "{} int foo(struct, x1, struct x2, x3, int, x5, x6, x7)\n"
|
const char* code = "{} int foo(struct, x1, struct x2, x3, int, x5, x6, x7)\n"
|
||||||
|
|
Loading…
Reference in New Issue