* @brief Is variable type some class with automatic deallocation? * @param var variable token * @return true unless it can be seen there is no automatic deallocation */
| 78 | * @return true unless it can be seen there is no automatic deallocation |
| 79 | */ |
| 80 | static bool isAutoDealloc(const Variable *var) |
| 81 | { |
| 82 | if (var->valueType() && var->valueType()->type != ValueType::Type::RECORD && var->valueType()->type != ValueType::Type::UNKNOWN_TYPE) |
| 83 | return false; |
| 84 | |
| 85 | // return false if the type is a simple record type without side effects |
| 86 | // a type that has no side effects (no constructors and no members with constructors) |
| 87 | /** @todo false negative: check constructors for side effects */ |
| 88 | return isAutoDeallocType(var->type()); |
| 89 | } |
| 90 | |
| 91 | template<std::size_t N> |
| 92 | static bool isVarTokComparison(const Token * tok, const Token ** vartok, |
no test coverage detected