mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
[C++] Allow template prefix on union declarations
This commit is contained in:
parent
33f5474951
commit
3bd80e7c54
@ -6997,7 +6997,7 @@ class DefinitionParser(BaseParser):
|
||||
if self.match(_visibility_re):
|
||||
visibility = self.matched_text
|
||||
|
||||
if objectType in ('type', 'concept', 'member', 'function', 'class'):
|
||||
if objectType in ('type', 'concept', 'member', 'function', 'class', 'union'):
|
||||
templatePrefix = self._parse_template_declaration_prefix(objectType)
|
||||
|
||||
if objectType == 'type':
|
||||
|
@ -912,6 +912,9 @@ def test_domain_cpp_ast_requires_clauses():
|
||||
check('class',
|
||||
'template<typename T> requires IsValid<T> {key}T : Base',
|
||||
{4: 'I0EIQ7IsValidI1TEE1T'}, key='class')
|
||||
check('union',
|
||||
'template<typename T> requires IsValid<T> {key}T',
|
||||
{4: 'I0EIQ7IsValidI1TEE1T'}, key='union')
|
||||
check('member',
|
||||
'template<typename T> requires IsValid<T> int Val = 7',
|
||||
{4: 'I0EIQ7IsValidI1TEE3Val'})
|
||||
|
Loading…
Reference in New Issue
Block a user