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

Fix crash when visiting typedef #547

Merged
merged 1 commit into from
Jun 17, 2020
Merged
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: 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