diff options
author | Jakob Lykke Andersen <jakobandersen@users.noreply.github.com> | 2020-08-13 17:29:18 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-13 17:29:18 +0200 |
commit | 667a188e25cb70a1c673081b066a8a90c6e8eea7 (patch) | |
tree | 7198bb289c0adc02ac614f54343ab5b826515ffa | |
parent | 99e36398fcb5fd4e07dd0dcad1c36afaa7e75800 (diff) | |
parent | d72fedb69d7a90eebf8ca92cbaa4c678c381e11a (diff) | |
download | sphinx-git-667a188e25cb70a1c673081b066a8a90c6e8eea7.tar.gz |
Merge pull request #8113 from jakobandersen/cpp_template_template
C++, fix template template parameter parsing
-rw-r--r-- | CHANGES | 1 | ||||
-rw-r--r-- | sphinx/domains/cpp.py | 1 | ||||
-rw-r--r-- | tests/test_domain_cpp.py | 1 |
3 files changed, 3 insertions, 0 deletions
@@ -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 46708b846..0b3c02e83 100644 --- a/sphinx/domains/cpp.py +++ b/sphinx/domains/cpp.py @@ -6251,6 +6251,7 @@ class DefinitionParser(BaseParser): # ========================================================================== 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 118227cd7..513205cab 100644 --- a/tests/test_domain_cpp.py +++ b/tests/test_domain_cpp.py @@ -764,6 +764,7 @@ def test_templates(): check('class', "template<template<typename> typename> {key}A", {2: "II0E0E1A"}) check('class', "template<template<typename> typename ...T> {key}A", {2: "II0EDpE1A"}) check('class', "template<template<typename> typename...> {key}A", {2: "II0EDpE1A"}) + check('class', "template<typename T, template<typename> typename...> {key}A", {2: "I0I0EDpE1A"}) check('class', "template<int> {key}A", {2: "I_iE1A"}) check('class', "template<int T> {key}A", {2: "I_iE1A"}) |