| 73 | } |
| 74 | |
| 75 | static bool isVariableCopyNeeded(const Variable &var, FunctionType type) |
| 76 | { |
| 77 | bool isOpEqual = false; |
| 78 | switch (type) { |
| 79 | case FunctionType::eOperatorEqual: |
| 80 | isOpEqual = true; |
| 81 | break; |
| 82 | case FunctionType::eCopyConstructor: |
| 83 | case FunctionType::eMoveConstructor: |
| 84 | break; |
| 85 | default: |
| 86 | return true; |
| 87 | } |
| 88 | |
| 89 | return (!var.hasDefault() || isOpEqual) && // default init does not matter for operator= |
| 90 | (var.isPointer() || |
| 91 | (var.type() && var.type()->needInitialization == Type::NeedInitialization::True) || |
| 92 | (var.valueType() && var.valueType()->type >= ValueType::Type::CHAR)); |
| 93 | } |
| 94 | |
| 95 | static bool isVclTypeInit(const Type *type) |
| 96 | { |