From d72fedb69d7a90eebf8ca92cbaa4c678c381e11a Mon Sep 17 00:00:00 2001 From: Jakob Lykke Andersen Date: Thu, 13 Aug 2020 17:08:39 +0200 Subject: [PATCH] C++, fix template template parameter parsing https://github.com/sphinx-doc/sphinx/pull/8037#issuecomment-673511490 --- CHANGES | 1 + sphinx/domains/cpp.py | 1 + tests/test_domain_cpp.py | 1 + 3 files changed, 3 insertions(+) diff --git a/CHANGES b/CHANGES index b852b699255..2826469670e 100644 --- a/CHANGES +++ b/CHANGES @@ -47,6 +47,7 @@ Bugs fixed class * #8091: autodoc: AttributeError is raised on documenting an attribute on Python 3.5.2 +* C++, fix parsing of template template paramters, broken by the fix of #7944 Testing -------- diff --git a/sphinx/domains/cpp.py b/sphinx/domains/cpp.py index 46708b846db..0b3c02e83f1 100644 --- a/sphinx/domains/cpp.py +++ b/sphinx/domains/cpp.py @@ -6251,6 +6251,7 @@ def parser() -> ASTExpression: # ========================================================================== def _parse_template_paramter(self) -> ASTTemplateParam: + self.skip_ws() if self.skip_word('template'): # declare a tenplate template parameter nestedParams = self._parse_template_parameter_list() diff --git a/tests/test_domain_cpp.py b/tests/test_domain_cpp.py index 118227cd799..513205cabca 100644 --- a/tests/test_domain_cpp.py +++ b/tests/test_domain_cpp.py @@ -764,6 +764,7 @@ def test_templates(): check('class', "template typename> {key}A", {2: "II0E0E1A"}) check('class', "template typename ...T> {key}A", {2: "II0EDpE1A"}) check('class', "template typename...> {key}A", {2: "II0EDpE1A"}) + check('class', "template typename...> {key}A", {2: "I0I0EDpE1A"}) check('class', "template {key}A", {2: "I_iE1A"}) check('class', "template {key}A", {2: "I_iE1A"})