def handle_signature(self, sig: str, signode: desc_signature) -> ASTDeclaration:
    parentSymbol = self.env.temp_data['cpp:parent_symbol']
    parser = DefinitionParser(sig, location=signode, config=self.env.config)
    try:
        ast = self.parse_definition(parser)
        parser.assert_end()
    except DefinitionError as e:
        logger.warning(e, location=signode)
        name = _make_phony_error_name()
        symbol = parentSymbol.add_name(name)
        self.env.temp_data['cpp:last_symbol'] = symbol
        raise ValueError
    try:
        symbol = parentSymbol.add_declaration(ast, docname=self.env.docname)
        assert (symbol.siblingAbove is None)
        assert (symbol.siblingBelow is None)
        symbol.siblingAbove = self.env.temp_data['cpp:last_symbol']
        if (symbol.siblingAbove is not None):
            assert (symbol.siblingAbove.siblingBelow is None)
            symbol.siblingAbove.siblingBelow = symbol
        self.env.temp_data['cpp:last_symbol'] = symbol
    except _DuplicateSymbolError as e:
        self.env.temp_data['cpp:last_symbol'] = e.symbol
        logger.warning('Duplicate declaration, %s', sig, location=signode)
    if (ast.objectType == 'enumerator'):
        self._add_enumerator_to_parent(ast)
    options = dict(self.options)
    options['tparam-line-spec'] = ('tparam-line-spec' in self.options)
    self.describe_signature(signode, ast, options)
    return ast
def handle_signature(self, sig: str, signode: desc_signature) -> ASTDeclaration:
    parentSymbol = self.env.temp_data['cpp:parent_symbol']
    parser = DefinitionParser(sig, location=signode, config=self.env.config)
    try:
        ast = self.parse_definition(parser)
        parser.assert_end()
    except DefinitionError as e:
        logger.warning(e, location=signode)
        name = _make_phony_error_name()
        symbol = parentSymbol.add_name(name)
        self.env.temp_data['cpp:last_symbol'] = symbol
        raise ValueError
    try:
        symbol = parentSymbol.add_declaration(ast, docname=self.env.docname)
        assert (symbol.siblingAbove is None)
        assert (symbol.siblingBelow is None)
        symbol.siblingAbove = self.env.temp_data['cpp:last_symbol']
        if (symbol.siblingAbove is not None):
            assert (symbol.siblingAbove.siblingBelow is None)
            symbol.siblingAbove.siblingBelow = symbol
        self.env.temp_data['cpp:last_symbol'] = symbol
    except _DuplicateSymbolError as e:
        self.env.temp_data['cpp:last_symbol'] = e.symbol
        logger.warning('Duplicate declaration, %s', sig, location=signode)
    if (ast.objectType == 'enumerator'):
        self._add_enumerator_to_parent(ast)
    options = dict(self.options)
    options['tparam-line-spec'] = ('tparam-line-spec' in self.options)
    self.describe_signature(signode, ast, options)
    return ast