summaryrefslogtreecommitdiff
path: root/sphinx/domains/cpp.py
diff options
context:
space:
mode:
authorJakob Lykke Andersen <jakobandersen@users.noreply.github.com>2020-04-17 15:17:45 +0200
committerGitHub <noreply@github.com>2020-04-17 15:17:45 +0200
commit21ca43719a08ea4aada4f99e3422f408fcb96057 (patch)
treef4c9737221e9614840db7a632b46b0ed0e1dab78 /sphinx/domains/cpp.py
parent86ef8521df8d848c85f0df01943656aa78a10a62 (diff)
parent9e6e45877078d1ff2f9835901caea34761bb9f04 (diff)
downloadsphinx-git-21ca43719a08ea4aada4f99e3422f408fcb96057.tar.gz
Merge pull request #7496 from jakobandersen/jbab-cpp-east-const-spacing
C++, rebased version of #7489
Diffstat (limited to 'sphinx/domains/cpp.py')
-rw-r--r--sphinx/domains/cpp.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/sphinx/domains/cpp.py b/sphinx/domains/cpp.py
index 79b6b9b03..aba487d07 100644
--- a/sphinx/domains/cpp.py
+++ b/sphinx/domains/cpp.py
@@ -2062,12 +2062,15 @@ class ASTDeclSpecs(ASTBase):
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