From 224a3435b92613b0345390a3323483abd2e28ebf Mon Sep 17 00:00:00 2001 From: Jan Babst Date: Wed, 15 Apr 2020 20:17:06 +0200 Subject: [PATCH 1/2] C++, fix spacing issue in east-const notation --- sphinx/domains/cpp.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/sphinx/domains/cpp.py b/sphinx/domains/cpp.py index 79b6b9b03d5..aba487d0708 100644 --- a/sphinx/domains/cpp.py +++ b/sphinx/domains/cpp.py @@ -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 From 9e6e45877078d1ff2f9835901caea34761bb9f04 Mon Sep 17 00:00:00 2001 From: Jakob Lykke Andersen Date: Fri, 17 Apr 2020 15:04:33 +0200 Subject: [PATCH 2/2] Updated changes --- CHANGES | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGES b/CHANGES index 93c06e571c1..04646ca5a3b 100644 --- a/CHANGES +++ b/CHANGES @@ -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 --------