diff --git a/lib/checkother.cpp b/lib/checkother.cpp index 171a69c12..81507e30c 100644 --- a/lib/checkother.cpp +++ b/lib/checkother.cpp @@ -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); } diff --git a/test/testother.cpp b/test/testother.cpp index f0ad3b538..268bebd10 100644 --- a/test/testother.cpp +++ b/test/testother.cpp @@ -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"