| 221 | } |
| 222 | |
| 223 | void CheckStringImpl::strPlusChar() |
| 224 | { |
| 225 | logChecker("CheckString::strPlusChar"); |
| 226 | const SymbolDatabase* symbolDatabase = mTokenizer->getSymbolDatabase(); |
| 227 | for (const Scope * scope : symbolDatabase->functionScopes) { |
| 228 | for (const Token* tok = scope->bodyStart->next(); tok != scope->bodyEnd; tok = tok->next()) { |
| 229 | if (tok->str() == "+") { |
| 230 | if (tok->astOperand1() && (tok->astOperand1()->tokType() == Token::eString)) { // string literal... |
| 231 | if (tok->astOperand2() && (tok->astOperand2()->tokType() == Token::eChar || isChar(tok->astOperand2()->variable()))) // added to char variable or char constant |
| 232 | strPlusCharError(tok); |
| 233 | } |
| 234 | } |
| 235 | } |
| 236 | } |
| 237 | } |
| 238 | |
| 239 | void CheckStringImpl::strPlusCharError(const Token *tok) |
| 240 | { |
no test coverage detected