Skip to content

Commit 9327df6

Browse files
committed
Avoid overwriting an existing symbol entry
Signed-off-by: Donald Hunter <[email protected]>
1 parent c2c1dc3 commit 9327df6

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

sphinx/domains/c/_symbol.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,9 @@ def _children(self) -> ValuesView[Symbol]:
123123

124124
def _add_child(self, child: Symbol) -> None:
125125
name = child.ident.name
126+
if name in self._childrenByName:
127+
# Duplicate so don't add - will be reported in _add_symbols()
128+
return
126129
self._childrenByName[name] = child
127130
if child.docname not in self._childrenByDocname:
128131
self._childrenByDocname[child.docname] = {}

0 commit comments

Comments
 (0)