| 675 | } |
| 676 | |
| 677 | static std::vector<const Token*> getAddressContainer(const Token* tok) |
| 678 | { |
| 679 | if (Token::simpleMatch(tok, "[") && tok->astOperand1()) |
| 680 | return { tok->astOperand1() }; |
| 681 | while (Token::simpleMatch(tok, "::") && tok->astOperand2()) |
| 682 | tok = tok->astOperand2(); |
| 683 | std::vector<ValueFlow::Value> values = ValueFlow::getLifetimeObjValues(tok, /*inconclusive*/ false); |
| 684 | std::vector<const Token*> res; |
| 685 | for (const auto& v : values) { |
| 686 | if (v.tokvalue) |
| 687 | res.emplace_back(v.tokvalue); |
| 688 | } |
| 689 | if (res.empty()) |
| 690 | res.emplace_back(tok); |
| 691 | return res; |
| 692 | } |
| 693 | |
| 694 | static bool isSameIteratorContainerExpression(const Token* tok1, |
| 695 | const Token* tok2, |
no test coverage detected