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

Function isExecutableScope

lib/symboldatabase.cpp:112–130  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

110}
111
112static bool isExecutableScope(const Token* tok)
113{
114 if (!Token::simpleMatch(tok, "{"))
115 return false;
116 const Token * tok2 = tok->link()->previous();
117 if (Token::simpleMatch(tok2, "; }"))
118 return true;
119 if (tok2 == tok)
120 return false;
121 if (Token::simpleMatch(tok2, "} }")) { // inner scope
122 const Token* startTok = tok2->link();
123 if (Token::Match(startTok->previous(), "do|try|else {"))
124 return true;
125 if (Token::Match(startTok->previous(), ")|] {"))
126 return !findLambdaStartToken(tok2);
127 return isExecutableScope(startTok);
128 }
129 return false;
130}
131
132const Token* SymbolDatabase::isEnumDefinition(const Token* tok)
133{

Callers 1

Calls 2

findLambdaStartTokenFunction · 0.85
simpleMatchFunction · 0.70

Tested by

no test coverage detected