From 5ea7a8ff4f73cdaa06a3b66374398a3752e24196 Mon Sep 17 00:00:00 2001 From: Takeshi KOMIYA Date: Sat, 7 Mar 2020 17:25:44 +0900 Subject: [PATCH] Fix #7276: cpp: objects generate hypertarget names unexpectedly --- CHANGES | 2 ++ sphinx/domains/cpp.py | 4 ---- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/CHANGES b/CHANGES index c5f26b37c54..2412519cb8d 100644 --- a/CHANGES +++ b/CHANGES @@ -26,6 +26,8 @@ Incompatible changes * #6903: Internal data structure of Python, reST and standard domains have changed. The node_id is added to the index of objects and modules. Now they contains a pair of docname and node_id for cross reference. +* #7276: c domain: Non intended behavior is removed such as ``say_hello_`` links + to ``.. cpp:function:: say_hello()`` * #7210: js domain: Non intended behavior is removed such as ``parseInt_`` links to ``.. js:function:: parseInt`` * #7229: rst domain: Non intended behavior is removed such as ``numref_`` links diff --git a/sphinx/domains/cpp.py b/sphinx/domains/cpp.py index a7ac237e442..0be9f5afd31 100644 --- a/sphinx/domains/cpp.py +++ b/sphinx/domains/cpp.py @@ -6512,10 +6512,6 @@ def add_target_and_index(self, ast: ASTDeclaration, sig: str, signode: desc_sign names = self.env.domaindata['cpp']['names'] if name not in names: names[name] = ast.symbol.docname - signode['names'].append(name) - else: - # print("[CPP] non-unique name:", name) - pass # always add the newest id assert newestId signode['ids'].append(newestId)