| 189 | } |
| 190 | |
| 191 | static ValueFlow::Value::MoveKind isMoveOrForward(const Token* tok) |
| 192 | { |
| 193 | if (!tok) |
| 194 | return ValueFlow::Value::MoveKind::NonMovedVariable; |
| 195 | const Token* parent = tok->astParent(); |
| 196 | if (!Token::simpleMatch(parent, "(")) |
| 197 | return ValueFlow::Value::MoveKind::NonMovedVariable; |
| 198 | const Token* ftok = parent->astOperand1(); |
| 199 | if (!ftok) |
| 200 | return ValueFlow::Value::MoveKind::NonMovedVariable; |
| 201 | if (Token::simpleMatch(ftok->astOperand1(), "std :: move")) |
| 202 | return ValueFlow::Value::MoveKind::MovedVariable; |
| 203 | if (Token::simpleMatch(ftok->astOperand1(), "std :: forward")) |
| 204 | return ValueFlow::Value::MoveKind::ForwardedVariable; |
| 205 | // TODO: Check for cast |
| 206 | return ValueFlow::Value::MoveKind::NonMovedVariable; |
| 207 | } |
| 208 | |
| 209 | virtual Action isModified(const Token* tok) const { |
| 210 | const ValueFlow::Value* value = getValue(tok); |
no test coverage detected