Fixed false positive when noreturn function is defined (#5601, second attempt)
This commit is contained in:
parent
6395cb9b95
commit
58c2f372b9
|
@ -1609,7 +1609,7 @@ void CheckOther::checkUnreachableCode()
|
|||
secondBreak = tok->tokAt(3);
|
||||
labelName = tok->next();
|
||||
} else if (Token::Match(tok, "%var% (") && _settings->library.isnoreturn(tok->str())) {
|
||||
if (!tok->function() || (tok->function()->token != tok && tok->function()->tokenDef != tok))
|
||||
if ((!tok->function() || (tok->function()->token != tok && tok->function()->tokenDef != tok)) && tok->linkAt(1)->strAt(1) != "{")
|
||||
secondBreak = tok->linkAt(1)->tokAt(2);
|
||||
}
|
||||
|
||||
|
|
|
@ -2871,6 +2871,12 @@ private:
|
|||
"}", 0, false, false, false, false, &settings);
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
|
||||
check("void NeonSession::exit()\n"
|
||||
"{\n"
|
||||
" SAL_INFO(\"ucb.ucp.webdav\", \"neon commands cannot be aborted\");\n"
|
||||
"}", 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