Skip to content

Commit

Permalink
Merge pull request #8113 from jakobandersen/cpp_template_template
Browse files Browse the repository at this point in the history
C++, fix template template parameter parsing
  • Loading branch information
jakobandersen committed Aug 13, 2020
2 parents 99e3639 + d72fedb commit 667a188
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGES
Expand Up @@ -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
--------
Expand Down
1 change: 1 addition & 0 deletions sphinx/domains/cpp.py
Expand Up @@ -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()
Expand Down
1 change: 1 addition & 0 deletions tests/test_domain_cpp.py
Expand Up @@ -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"})
Expand Down

0 comments on commit 667a188

Please sign in to comment.