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;
|
return nullptr;
|
||||||
if (tok->str() == "(")
|
if (tok->str() == "(")
|
||||||
tok = tok->link();
|
tok = tok->link();
|
||||||
if (Token::Match(tok, ") const| &|&&| [;:{=]")) {
|
if (Token::Match(tok, ") const| [;{]")) {
|
||||||
tok = tok->next();
|
tok = tok->next();
|
||||||
if (tok->isName())
|
if (tok->isName())
|
||||||
tok = tok->next();
|
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;
|
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();
|
tok = tok->next();
|
||||||
while (tok->isName())
|
while (tok->isName())
|
||||||
tok = tok->next();
|
tok = tok->next();
|
||||||
tok = tok->link()->next();
|
if (Token::Match(tok, "&|&&"))
|
||||||
while (tok && tok->isName())
|
|
||||||
tok = tok->next();
|
tok = tok->next();
|
||||||
|
if (tok->str() == "(")
|
||||||
|
tok = tok->link()->next();
|
||||||
if (Token::Match(tok, "= 0|default|delete ;"))
|
if (Token::Match(tok, "= 0|default|delete ;"))
|
||||||
tok = tok->tokAt(2);
|
tok = tok->tokAt(2);
|
||||||
return (tok && endsWith.find(tok->str()) != std::string::npos) ? tok : nullptr;
|
return (tok && endsWith.find(tok->str()) != std::string::npos) ? tok : nullptr;
|
||||||
|
|
Loading…
Reference in New Issue