fix removal of throw() from const functions
This commit is contained in:
parent
fec9edf628
commit
7e04ea0859
|
@ -8558,9 +8558,15 @@ void Tokenizer::removeExceptionSpecifications(Token *tok) const
|
|||
else if (tok->str() == "}")
|
||||
break;
|
||||
|
||||
else if (Token::simpleMatch(tok, ") throw ("))
|
||||
else if (Token::Match(tok, ") const| throw ("))
|
||||
{
|
||||
Token::eraseTokens(tok, tok->tokAt(2)->link());
|
||||
if (tok->next()->str() == "const")
|
||||
{
|
||||
Token::eraseTokens(tok->next(), tok->tokAt(3)->link());
|
||||
tok = tok->next();
|
||||
}
|
||||
else
|
||||
Token::eraseTokens(tok, tok->tokAt(2)->link());
|
||||
tok->deleteNext();
|
||||
}
|
||||
|
||||
|
|
|
@ -3301,6 +3301,11 @@ private:
|
|||
" { return 0; }\n"
|
||||
"};\n");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
|
||||
checkConst("class Fred {\n"
|
||||
" const std::string foo() const throw() { return ""; }\n"
|
||||
"};\n");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
}
|
||||
|
||||
void const2()
|
||||
|
|
Loading…
Reference in New Issue