Fixed related issues to #5601
This commit is contained in:
parent
7e74ecca76
commit
8d5be8c4a4
|
@ -1608,7 +1608,7 @@ void CheckOther::checkUnreachableCode()
|
|||
} else if (Token::Match(tok, "goto %any% ;")) {
|
||||
secondBreak = tok->tokAt(3);
|
||||
labelName = tok->next();
|
||||
} else if (Token::Match(tok, "%var% (") && _settings->library.isnoreturn(tok->str())) {
|
||||
} else if (Token::Match(tok, "%var% (") && _settings->library.isnoreturn(tok->str()) && tok->strAt(-1) != ".") {
|
||||
if ((!tok->function() || (tok->function()->token != tok && tok->function()->tokenDef != tok)) && tok->linkAt(1)->strAt(1) != "{")
|
||||
secondBreak = tok->linkAt(1)->tokAt(2);
|
||||
}
|
||||
|
|
|
@ -2877,6 +2877,9 @@ private:
|
|||
"}", 0, false, false, false, false, &settings);
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
|
||||
check("void foo() { xResAccess->exit(); }", 0, false, false, false, false, &settings);
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
|
||||
check("void foo(int a)\n"
|
||||
"{\n"
|
||||
" switch(a) {\n"
|
||||
|
|
Loading…
Reference in New Issue