Skip to content

Commit

Permalink
Fix extraneous 'static'
Browse files Browse the repository at this point in the history
Fixes #717
  • Loading branch information
jakobandersen committed Jul 27, 2021
1 parent d8add71 commit d86c1e8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
1 change: 1 addition & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,7 @@ Inspired by `Keepachangelog.com <http://keepachangelog.com/>`__.
- Unreleased - Breathe v4.31.0

- Collapse multiple retvals into a single bullet list. #697
- Fix duplicate ``static`` in function declarations. #717

- 2021-05-06 - Breathe v4.30.0

Expand Down
12 changes: 7 additions & 5 deletions breathe/renderer/sphinxrenderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1851,11 +1851,13 @@ def visit_function(self, node) -> List[Node]:
elements.append('virtual')
if node.explicit == 'yes':
elements.append('explicit')
if 'constexpr' in dir(node):
assert node.constexpr == 'yes'
elements.append('constexpr')
elements.append(''.join(n.astext()
for n in self.render(node.get_type()))) # type: ignore
# TODO: handle constexpr when parser has been updated
# but Doxygen seems to leave it in the type anyway
typ = ''.join(n.astext() for n in self.render(node.get_type()))
# Doxygen sometimes leaves 'static' in the type,
# e.g., for "constexpr static auto f()"
typ = typ.replace('static ', '')
elements.append(typ)
elements.append(name)
elements.append(node.get_argsstring())
declaration = ' '.join(elements)
Expand Down

0 comments on commit d86c1e8

Please sign in to comment.