const parameter: Added comment to reduce false negatives for various classes in the std namespace

This commit is contained in:
Daniel Marjamäki 2011-04-20 05:40:06 +02:00
parent 712e285bd6
commit 8417c4eb28
1 changed files with 5 additions and 0 deletions

View File

@ -2517,6 +2517,11 @@ void CheckOther::checkConstantFunctionParameter()
for (const Token *tok = _tokenizer->tokens(); tok; tok = tok->next())
{
// TODO: False negatives. This pattern only checks for string.
// Investigate if there are other classes in the std
// namespace and add them to the pattern. There are
// streams for example (however it seems strange with
// const stream parameter).
if (Token::Match(tok, "[,(] const std :: string %var% [,)]"))
{
passedByValueError(tok, tok->strAt(5));