Tokenizer::isFunctionHead(): Handling of C++ methods only in isCPP() condition.
This commit is contained in:
parent
be8fc0f89f
commit
9dabd17eae
|
@ -58,23 +58,20 @@ const Token * Tokenizer::isFunctionHead(const Token *tok, const std::string &end
|
|||
return nullptr;
|
||||
if (tok->str() == "(")
|
||||
tok = tok->link();
|
||||
if (Token::Match(tok, ") const| &|&&| [;:{=]")) {
|
||||
if (Token::Match(tok, ") const| [;{]")) {
|
||||
tok = tok->next();
|
||||
if (tok->isName())
|
||||
tok = tok->next();
|
||||
if (Token::Match(tok, "&|&&"))
|
||||
tok = tok->next();
|
||||
if (Token::Match(tok, "= 0|default|delete ;"))
|
||||
tok = tok->tokAt(2);
|
||||
return (endsWith.find(tok->str()) != std::string::npos) ? tok : nullptr;
|
||||
}
|
||||
if (isCPP() && Token::Match(tok, ") const| throw|noexcept (")) {
|
||||
if (isCPP() && (Token::Match(tok, ") const| throw|noexcept (") || Token::Match(tok, ") const| &|&&| [;:{=]"))) {
|
||||
tok = tok->next();
|
||||
while (tok->isName())
|
||||
tok = tok->next();
|
||||
tok = tok->link()->next();
|
||||
while (tok && tok->isName())
|
||||
if (Token::Match(tok, "&|&&"))
|
||||
tok = tok->next();
|
||||
if (tok->str() == "(")
|
||||
tok = tok->link()->next();
|
||||
if (Token::Match(tok, "= 0|default|delete ;"))
|
||||
tok = tok->tokAt(2);
|
||||
return (tok && endsWith.find(tok->str()) != std::string::npos) ? tok : nullptr;
|
||||
|
|
Loading…
Reference in New Issue