From 8417c4eb28cd8ac830ce0ceef0ac1eb5914bbd5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Wed, 20 Apr 2011 05:40:06 +0200 Subject: [PATCH] const parameter: Added comment to reduce false negatives for various classes in the std namespace --- lib/checkother.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/checkother.cpp b/lib/checkother.cpp index 9ad1f62a1..3668787ee 100644 --- a/lib/checkother.cpp +++ b/lib/checkother.cpp @@ -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));