Skip to content

Commit

Permalink
Merge pull request sphinx-doc#7496 from jakobandersen/jbab-cpp-east-c…
Browse files Browse the repository at this point in the history
…onst-spacing

C++, rebased version of sphinx-doc#7489
  • Loading branch information
jakobandersen committed Apr 17, 2020
2 parents 86ef852 + 9e6e458 commit 21ca437
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGES
Expand Up @@ -21,6 +21,7 @@ Bugs fixed

* #7461: py domain: fails with IndexError for empty tuple in type annotation
* #7461: autodoc: empty tuple in type annotation is not shown correctly
* C++, fix spacing issue in east-const declarations.

Testing
--------
Expand Down
11 changes: 7 additions & 4 deletions sphinx/domains/cpp.py
Expand Up @@ -2062,12 +2062,15 @@ def describe_signature(self, signode: TextElement, mode: str,
if self.trailingTypeSpec:
if addSpace:
signode += nodes.Text(' ')
numChildren = len(signode)
self.trailingTypeSpec.describe_signature(signode, mode, env,
symbol=symbol)
numChildren = len(signode)
self.rightSpecs.describe_signature(signode)
if len(signode) != numChildren:
signode += nodes.Text(' ')
addSpace = len(signode) != numChildren

if len(str(self.rightSpecs)) > 0:
if addSpace:
signode += nodes.Text(' ')
self.rightSpecs.describe_signature(signode)


# Declarator
Expand Down

0 comments on commit 21ca437

Please sign in to comment.