| 4082 | } |
| 4083 | |
| 4084 | static bool isVariableInit(const Token *tok) |
| 4085 | { |
| 4086 | if (!tok) |
| 4087 | return false; |
| 4088 | if (!Token::Match(tok->previous(), "%var% (|{")) |
| 4089 | return false; |
| 4090 | if (!tok->isBinaryOp() && !(tok->astOperand1() && tok->link() == tok->next())) |
| 4091 | return false; |
| 4092 | if (Token::simpleMatch(tok->astOperand2(), ",")) |
| 4093 | return false; |
| 4094 | const Variable* var = tok->astOperand1()->variable(); |
| 4095 | if (!var) |
| 4096 | return false; |
| 4097 | if (var->nameToken() != tok->astOperand1()) |
| 4098 | return false; |
| 4099 | const ValueType* vt = var->valueType(); |
| 4100 | if (!vt) |
| 4101 | return false; |
| 4102 | if (vt->type < ValueType::Type::VOID) |
| 4103 | return false; |
| 4104 | return true; |
| 4105 | } |
| 4106 | |
| 4107 | // Return true if two associative containers intersect |
| 4108 | template<class C1, class C2> |
no test coverage detected