MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / isnoreturn

Method isnoreturn

lib/library.cpp:1791–1812  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1789}
1790
1791bool Library::isnoreturn(const Token *ftok) const
1792{
1793 if (ftok->function() && ftok->function()->isAttributeNoreturn())
1794 return true;
1795 if (ftok->variable() && ftok->variable()->nameToken()->isAttributeNoreturn())
1796 return true;
1797 if (isNotLibraryFunction(ftok)) {
1798 if (Token::simpleMatch(ftok->astParent(), ".")) {
1799 const Token* contTok = ftok->astParent()->astOperand1();
1800 if (astContainerAction(contTok, *this) != Library::Container::Action::NO_ACTION ||
1801 astContainerYield(contTok, *this) != Library::Container::Yield::NO_YIELD)
1802 return false;
1803 }
1804 return false;
1805 }
1806 const auto it = utils::as_const(mData->mNoReturn).find(getFunctionName(ftok));
1807 if (it == mData->mNoReturn.end())
1808 return false;
1809 if (it->second == LibraryData::FalseTrueMaybe::Maybe)
1810 return true;
1811 return it->second == LibraryData::FalseTrueMaybe::True;
1812}
1813
1814bool Library::isnotnoreturn(const Token *ftok) const
1815{

Callers 8

checkFileUsageMethod · 0.80
checkUnreachableCodeMethod · 0.80
checkMissingReturnScopeFunction · 0.80
dumpMethod · 0.80
isEscapedFunction · 0.80
isEscapedOrJumpFunction · 0.80
isEscapeFunctionFunction · 0.80
hasNoreturnFunctionFunction · 0.80

Calls 10

astContainerActionFunction · 0.85
astContainerYieldFunction · 0.85
variableMethod · 0.80
astParentMethod · 0.80
astOperand1Method · 0.80
simpleMatchFunction · 0.70
functionMethod · 0.45
nameTokenMethod · 0.45
findMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected