Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove duplicated virtual functions from using-declarations #968

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions breathe/parser/compound.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,19 @@ class sectiondefTypeSub(supermod.sectiondefType):
def __init__(self, kind=None, header='', description=None, memberdef=None):
supermod.sectiondefType.__init__(self, kind, header, description, memberdef)

def build(self, node_):
super().build(node_)

to_be_removed = []
for index, member1 in enumerate(self.memberdef[:-1]):
refids = [base.refid for base in member1.reimplements]
for member2 in self.memberdef[index + 1:]:
member2_refids = [base.refid for base in member2.reimplements]
if any(refid in member2_refids for refid in refids):
to_be_removed.append(member2)

for member in to_be_removed:
self.memberdef.remove(member)

supermod.sectiondefType.subclass = sectiondefTypeSub
# end class sectiondefTypeSub
Expand Down