Fixed #6548 also for noexcept
This commit is contained in:
parent
72bc6d1f33
commit
2ac8da0497
|
@ -62,7 +62,7 @@ const Token * Tokenizer::isFunctionHead(const Token *tok, const std::string &end
|
||||||
tok = tok->next();
|
tok = tok->next();
|
||||||
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 (")) {
|
if (isCPP() && Token::Match(tok, ") const| throw|noexcept (")) {
|
||||||
tok = tok->next();
|
tok = tok->next();
|
||||||
while (tok->isName())
|
while (tok->isName())
|
||||||
tok = tok->next();
|
tok = tok->next();
|
||||||
|
|
|
@ -992,6 +992,20 @@ private:
|
||||||
"void fred ( int x@1 ) throw ( ) { } "
|
"void fred ( int x@1 ) throw ( ) { } "
|
||||||
"void wilma ( ) { x ++ ; }\n";
|
"void wilma ( ) { x ++ ; }\n";
|
||||||
ASSERT_EQUALS(expected3, tokenize(code3, false, "test.cpp"));
|
ASSERT_EQUALS(expected3, tokenize(code3, false, "test.cpp"));
|
||||||
|
|
||||||
|
const char code4[] = "void fred(int x) noexcept() {}"
|
||||||
|
"void wilma() { x++; }";
|
||||||
|
const char expected4[] = "\n\n##file 0\n1: "
|
||||||
|
"void fred ( int x@1 ) noexcept ( ) { } "
|
||||||
|
"void wilma ( ) { x ++ ; }\n";
|
||||||
|
ASSERT_EQUALS(expected4, tokenize(code4, false, "test.cpp"));
|
||||||
|
|
||||||
|
const char code5[] = "void fred(int x) noexcept {}"
|
||||||
|
"void wilma() { x++; }";
|
||||||
|
const char expected5[] = "\n\n##file 0\n1: "
|
||||||
|
"void fred ( int x@1 ) noexcept { } "
|
||||||
|
"void wilma ( ) { x ++ ; }\n";
|
||||||
|
ASSERT_EQUALS(expected5, tokenize(code5, false, "test.cpp"));
|
||||||
}
|
}
|
||||||
|
|
||||||
void varid57() { // #6636: new scope by {}
|
void varid57() { // #6636: new scope by {}
|
||||||
|
|
Loading…
Reference in New Issue