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

Method diag

lib/checkcondition.cpp:55–74  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

53//---------------------------------------------------------------------------
54
55bool CheckConditionImpl::diag(const Token* tok, bool insert)
56{
57 if (!tok)
58 return false;
59 const Token* parent = tok->astParent();
60 bool hasParent = false;
61 while (Token::Match(parent, "!|&&|%oror%")) {
62 if (mCondDiags.count(parent) != 0) {
63 hasParent = true;
64 break;
65 }
66 parent = parent->astParent();
67 }
68 if (mCondDiags.count(tok) == 0 && !hasParent) {
69 if (insert)
70 mCondDiags.insert(tok);
71 return false;
72 }
73 return true;
74}
75
76bool CheckConditionImpl::diag(const Token* tok1, const Token* tok2)
77{

Callers

nothing calls this directly

Calls 2

astParentMethod · 0.80
diagFunction · 0.70

Tested by

no test coverage detected