summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES1
-rw-r--r--sphinx/domains/cpp.py11
2 files changed, 8 insertions, 4 deletions
diff --git a/CHANGES b/CHANGES
index 93c06e571..04646ca5a 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
--------
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