summaryrefslogtreecommitdiff
path: root/sphinx/domains/c.py
diff options
context:
space:
mode:
Diffstat (limited to 'sphinx/domains/c.py')
-rw-r--r--sphinx/domains/c.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/sphinx/domains/c.py b/sphinx/domains/c.py
index 6e0dc2a54..164a87254 100644
--- a/sphinx/domains/c.py
+++ b/sphinx/domains/c.py
@@ -186,11 +186,17 @@ class ASTNestedName(ASTBase):
# If lastIsName, then wrap all of the prefix in a desc_addname,
# else append directly to signode.
# TODO: also for C?
- # NOTE: Breathe relies on the prefix being in the desc_addname node,
+ # NOTE: Breathe previously relied on the prefix being in the desc_addname node,
# so it can remove it in inner declarations.
dest = signode
if mode == 'lastIsName':
dest = addnodes.desc_addname()
+ if self.rooted:
+ prefix += '.'
+ if mode == 'lastIsName' and len(names) == 0:
+ signode += nodes.Text('.')
+ else:
+ dest += nodes.Text('.')
for i in range(len(names)):
ident = names[i]
if not first: