| 247 | } |
| 248 | |
| 249 | static bool isMacroUsage(const Token* tok) |
| 250 | { |
| 251 | if (const Token* parent = tok->astParent()) { |
| 252 | while (parent && (parent->isCast() || parent->str() == "&&")) { |
| 253 | if (parent->isExpandedMacro()) |
| 254 | return true; |
| 255 | parent = parent->astParent(); |
| 256 | } |
| 257 | if (!parent) |
| 258 | return false; |
| 259 | if (parent->isExpandedMacro()) |
| 260 | return true; |
| 261 | if (parent->isUnaryOp("!") || parent->isComparisonOp()) { |
| 262 | int argn{}; |
| 263 | const Token* ftok = getTokenArgumentFunction(parent, argn); |
| 264 | if (ftok && !ftok->function()) |
| 265 | return true; |
| 266 | } |
| 267 | } |
| 268 | return false; |
| 269 | } |
| 270 | |
| 271 | //--------------------------------------------------------------------------- |
| 272 | // Implicit casts of string literals to bool |
no test coverage detected