C++, add missing isPack for some template params

Fixes sphinx-doc/sphinx#5126
This commit is contained in:
Jakob Lykke Andersen 2018-08-10 22:52:36 +02:00
parent ef5448e8bc
commit 0af74a76dc
2 changed files with 29 additions and 0 deletions

View File

@ -207,6 +207,7 @@ Bugs fixed
* epub: spine has been broken when "self" is listed on toctree (refs: #4611)
* #344: autosummary does not understand docstring of module level attributes
* #5191: C++, prevent nested declarations in functions to avoid lookup problems.
* #5126: C++, add missing isPack method for certain template parameter types.
* #5002: graphviz: SVGs do not adapt to the column width
Testing

View File

@ -1492,6 +1492,10 @@ class ASTTemplateParamConstrainedTypeWithInit(ASTBase):
# type: () -> ASTNestedName
return self.type.name
@property
def isPack(self):
return self.type.isPack
def get_id(self, version, objectType=None, symbol=None):
# type: (int, unicode, Symbol) -> unicode
# this is not part of the normal name mangling in C++
@ -1531,6 +1535,10 @@ class ASTTemplateParamTemplateType(ASTBase):
id = self.get_identifier()
return ASTNestedName([ASTNestedNameElement(id, None)], [False], rooted=False)
@property
def isPack(self):
return self.data.parameterPack
def get_identifier(self):
# type: () -> unicode
return self.data.get_identifier()
@ -1567,6 +1575,10 @@ class ASTTemplateParamNonType(ASTBase):
id = self.get_identifier()
return ASTNestedName([ASTNestedNameElement(id, None)], [False], rooted=False)
@property
def isPack(self):
return self.param.isPack
def get_identifier(self):
# type: () -> unicode
name = self.param.name
@ -2635,6 +2647,10 @@ class ASTDeclaratorRef(ASTBase):
# type: () -> ASTNestedName
return self.next.name
@property
def isPack(self):
return True
@property
def function_params(self):
# type: () -> Any
@ -2916,6 +2932,10 @@ class ASTDeclaratorNameParamQual(ASTBase):
# type: () -> ASTNestedName
return self.declId
@property
def isPack(self):
return False
@property
def function_params(self):
# type: () -> Any
@ -3014,6 +3034,10 @@ class ASTType(ASTBase):
# type: () -> ASTNestedName
return self.decl.name
@property
def isPack(self):
return self.decl.isPack
@property
def function_params(self):
# type: () -> Any
@ -3105,6 +3129,10 @@ class ASTTypeWithInit(ASTBase):
# type: () -> ASTNestedName
return self.type.name
@property
def isPack(self):
return self.type.isPack
def get_id(self, version, objectType=None, symbol=None):
# type: (int, unicode, Symbol) -> unicode
if objectType != 'member':