Skip to content

Commit

Permalink
Fix compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
chrchr-github committed Jul 6, 2023
1 parent fe3fb5a commit b7af044
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/checkclass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2888,8 +2888,10 @@ void CheckClass::checkDuplInheritedMembers()

namespace {
struct DuplMemberInfo {
const Variable* classVar{}, *parentClassVar{};
const Type::BaseInfo* parentClass{};
DuplMemberInfo(const Variable* cv, const Variable* pcv, const Type::BaseInfo* pc) : classVar(cv), parentClassVar(pcv), parentClass(pc) {}
const Variable* classVar;
const Variable* parentClassVar;
const Type::BaseInfo* parentClass;
};
}

Expand All @@ -2907,7 +2909,7 @@ static std::vector<DuplMemberInfo> hasDuplInheritedMembersRecursive(const Type*
for (const Variable &classVarIt : typeCurrent->classScope->varlist) {
for (const Variable &parentClassVarIt : parentClassIt.type->classScope->varlist) {
if (classVarIt.name() == parentClassVarIt.name() && !parentClassVarIt.isPrivate()) // Check if the class and its parent have a common variable
results.emplace_back(DuplMemberInfo{ &classVarIt, &parentClassVarIt, &parentClassIt });
results.emplace_back(&classVarIt, &parentClassVarIt, &parentClassIt);
}
}
if (typeCurrent != parentClassIt.type) {
Expand Down

0 comments on commit b7af044

Please sign in to comment.