Skip to content

Commit

Permalink
Fix C++ multiline signatures
Browse files Browse the repository at this point in the history
Fixes #3877
  • Loading branch information
jakobandersen committed Aug 31, 2017
1 parent 29b1d2f commit ff06cb8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGES
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ Bugs fixed
* #3960: default_role = 'guilabel' not functioning
* Missing ``texinputs_win/Makefile`` to be used in latexpdf builder on windows.
* #4026: nature: Fix macOS Safari scrollbar color
* #3877: Fix for C++ multiline signatures.

Testing
--------
Expand Down
7 changes: 5 additions & 2 deletions sphinx/domains/cpp.py
Original file line number Diff line number Diff line change
Expand Up @@ -4582,8 +4582,11 @@ def handle_signature(self, sig, signode):
if ast.objectType == 'enumerator':
self._add_enumerator_to_parent(ast)

self.options['tparam-line-spec'] = 'tparam-line-spec' in self.options
self.describe_signature(signode, ast, self.options)
# note: handle_signature may be called multiple time per directive,
# if it has multiple signatures, so don't mess with the original options.
options = dict(self.options)
options['tparam-line-spec'] = 'tparam-line-spec' in self.options
self.describe_signature(signode, ast, options)
return ast

def before_content(self):
Expand Down

0 comments on commit ff06cb8

Please sign in to comment.