| 431 | } |
| 432 | |
| 433 | static bool hasNonCopyableBase(const Scope *scope, bool *unknown) |
| 434 | { |
| 435 | // check if there is base class that is not copyable |
| 436 | for (const Type::BaseInfo &baseInfo : scope->definedType->derivedFrom) { |
| 437 | if (!baseInfo.type || !baseInfo.type->classScope) { |
| 438 | *unknown = true; |
| 439 | continue; |
| 440 | } |
| 441 | |
| 442 | if (hasNonCopyableBase(baseInfo.type->classScope, unknown)) |
| 443 | return true; |
| 444 | |
| 445 | for (const Function &func : baseInfo.type->classScope->functionList) { |
| 446 | if (func.type != FunctionType::eCopyConstructor) |
| 447 | continue; |
| 448 | if (func.access == AccessControl::Private || func.isDelete()) { |
| 449 | *unknown = false; |
| 450 | return true; |
| 451 | } |
| 452 | } |
| 453 | } |
| 454 | return false; |
| 455 | } |
| 456 | |
| 457 | void CheckClassImpl::copyconstructors() |
| 458 | { |