diff options
author | Jan Babst <jan.babst@live.de> | 2020-04-15 20:17:06 +0200 |
---|---|---|
committer | Jakob Lykke Andersen <Jakob@caput.dk> | 2020-04-17 15:01:29 +0200 |
commit | 224a3435b92613b0345390a3323483abd2e28ebf (patch) | |
tree | ed9e64c4794c815595469ac8fe8a6e0b30d1d365 | |
parent | 86ef8521df8d848c85f0df01943656aa78a10a62 (diff) | |
download | sphinx-git-224a3435b92613b0345390a3323483abd2e28ebf.tar.gz |
C++, fix spacing issue in east-const notation
-rw-r--r-- | sphinx/domains/cpp.py | 11 |
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 |