Merge pull request #7496 from jakobandersen/jbab-cpp-east-const-spacing

C++, rebased version of #7489
This commit is contained in:
Jakob Lykke Andersen 2020-04-17 15:17:45 +02:00 committed by GitHub
commit 21ca43719a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 4 deletions

View File

@ -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
--------

View File

@ -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