| 1384 | } |
| 1385 | |
| 1386 | static bool isConditionKnown(const Token* tok, bool then) |
| 1387 | { |
| 1388 | const char* op = "||"; |
| 1389 | if (then) |
| 1390 | op = "&&"; |
| 1391 | const Token* parent = tok->astParent(); |
| 1392 | while (parent && (parent->str() == op || parent->str() == "!" || parent->isCast())) |
| 1393 | parent = parent->astParent(); |
| 1394 | const Token* top = tok->astTop(); |
| 1395 | if (Token::Match(top->previous(), "if|while|for (")) |
| 1396 | return parent == top || Token::simpleMatch(parent, ";"); |
| 1397 | return parent && parent->str() != op; |
| 1398 | } |
| 1399 | |
| 1400 | enum class LifetimeCapture : std::uint8_t { Undefined, ByValue, ByReference }; |
| 1401 |
no test coverage detected