Skip to content

Commit

Permalink
Merge pull request #547 from utzig/fix-typedef-crash
Browse files Browse the repository at this point in the history
Fix crash when visiting typedef
  • Loading branch information
vermeeren authored Jun 17, 2020
2 parents 75d0803 + 1da9574 commit 1828e04
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions breathe/renderer/sphinxrenderer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1455,13 +1455,18 @@ def visit_typedef(self, node) -> List[Node]:
names = self.get_qualification()
names.append(node.get_name())
name = self.join_nested_name(names)
if node.definition.startswith('typedef '):
declaration = ' '.join([type_, name, node.get_argsstring()])
elif node.definition.startswith('using '):
if node.definition.startswith('using '):
# TODO: looks like Doxygen does not generate the proper XML
# for the template paramter list
# for the template parameter list
declaration = self.create_template_prefix(node)
declaration += ' ' + name + " = " + type_
else:
# TODO: Both "using" and "typedef" keywords get into this function,
# and if no @typedef comment was added, the definition should
# contain the full text. If a @typedef was used instead, the
# definition has only the typename, which makes it impossible to
# distinguish between them so fallback to "typedef" behavior here.
declaration = ' '.join([type_, name, node.get_argsstring()])
return self.handle_declaration(node, declaration)

def make_initializer(self, node) -> str:
Expand Down

0 comments on commit 1828e04

Please sign in to comment.