| 3251 | } |
| 3252 | |
| 3253 | bool isIteratorPair(const std::vector<const Token*>& args) |
| 3254 | { |
| 3255 | if (args.size() != 2) |
| 3256 | return false; |
| 3257 | if (astIsPointer(args[0]) && astIsPointer(args[1])) |
| 3258 | return true; |
| 3259 | // Check if iterator is from same container |
| 3260 | const Token* tok1 = nullptr; |
| 3261 | const Token* tok2 = nullptr; |
| 3262 | if (astIsIterator(args[0]) && astIsIterator(args[1])) { |
| 3263 | tok1 = ValueFlow::getLifetimeObjValue(args[0]).tokvalue; |
| 3264 | tok2 = ValueFlow::getLifetimeObjValue(args[1]).tokvalue; |
| 3265 | if (!tok1 || !tok2) |
| 3266 | return true; |
| 3267 | } else { |
| 3268 | tok1 = getIteratorExpression(args[0]); |
| 3269 | tok2 = getIteratorExpression(args[1]); |
| 3270 | } |
| 3271 | if (tok1 && tok2) |
| 3272 | return tok1->exprId() == tok2->exprId(); |
| 3273 | return tok1 || tok2; |
| 3274 | } |
| 3275 | |
| 3276 | const Token *findLambdaStartToken(const Token *last) |
| 3277 | { |
no test coverage detected