MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / hasNonCopyableBase

Function hasNonCopyableBase

lib/checkclass.cpp:433–455  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

431}
432
433static 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
457void CheckClassImpl::copyconstructors()
458{

Callers 1

copyconstructorsMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected