From 2d20e337b3838e23c64ec6bf353509fa60b732e9 Mon Sep 17 00:00:00 2001 From: Jakob Lykke Andersen Date: Tue, 14 Jun 2016 15:17:45 +0900 Subject: [PATCH] C++, properly look up constructors. Fixes sphinx-doc/sphinx#2666. --- CHANGES | 1 + sphinx/domains/cpp.py | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/CHANGES b/CHANGES index 04ce97389f..3c1b5d981a 100644 --- a/CHANGES +++ b/CHANGES @@ -26,6 +26,7 @@ Bugs fixed * #2639: Sphinx now bundles iftex.sty * Failed to build PDF with framed.sty 0.95 * Sphinx now bundles needspace.sty +* #2666: C++, properly look up nested names involving constructors. Release 1.4.3 (released Jun 5, 2016) diff --git a/sphinx/domains/cpp.py b/sphinx/domains/cpp.py index 5d15d30201..a64b488cd9 100644 --- a/sphinx/domains/cpp.py +++ b/sphinx/domains/cpp.py @@ -2660,6 +2660,10 @@ class Symbol(object): if symbol is None: # TODO: maybe search without template args return None + # We have now matched part of a nested name, and need to match more + # so even if we should matchSelf before, we definitely shouldn't + # even more. (see also issue #2666) + matchSelf = False parentSymbol = symbol assert False # should have returned in the loop @@ -4114,6 +4118,7 @@ class CPPDomain(Domain): matchSelf=True) if s is None or s.declaration is None: return None, None + declaration = s.declaration fullNestedName = s.get_full_nested_name() name = text_type(fullNestedName).lstrip(':')