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

Function getAllVariableMembers

lib/checkclass.cpp:708–722  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

706}
707
708static void getAllVariableMembers(const Scope *scope, std::vector<const Variable *>& varList)
709{
710 std::transform(scope->varlist.cbegin(), scope->varlist.cend(), std::back_inserter(varList), [](const Variable& var) {
711 return &var;
712 });
713 if (scope->definedType) {
714 for (const Type::BaseInfo& baseInfo: scope->definedType->derivedFrom) {
715 if (scope->definedType == baseInfo.type)
716 continue;
717 const Scope *baseClass = baseInfo.type ? baseInfo.type->classScope : nullptr;
718 if (baseClass && baseClass->isClassOrStruct() && baseClass->numConstructors == 0)
719 getAllVariableMembers(baseClass, varList);
720 }
721 }
722}
723
724std::vector<CheckClassImpl::Usage> CheckClassImpl::createUsageList(const Scope *scope)
725{

Callers 1

createUsageListMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected