Skip to content

Commit 88619ef

Browse files
authored
skip forward declarations
1 parent 42fbf37 commit 88619ef

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pybind11_mkdoc/mkdoc_lib.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,11 @@ def extract(filename, node, prefix, output):
222222
for i in node.get_children():
223223
extract(filename, i, sub_prefix, output)
224224
if node.kind in PRINT_LIST:
225+
# Skip forward declarations
226+
if node.kind == CursorKind.STRUCT_DECL or node.kind == CursorKind.CLASS_DECL:
227+
definition = node.get_definition()
228+
if not definition:
229+
return
225230
comment = d(node.raw_comment) if node.raw_comment is not None else ''
226231
comment = process_comment(comment)
227232
sub_prefix = prefix

0 commit comments

Comments
 (0)