def apply(self, **kwargs: Any) -> None:
    for node in self.document.traverse(AliasNode):
        sig = node.sig
        parentKey = node.parentKey
        try:
            parser = DefinitionParser(sig, location=node, config=self.env.config)
            (ast, isShorthand) = parser.parse_xref_object()
            parser.assert_end()
        except DefinitionError as e:
            logger.warning(e, location=node)
            (ast, isShorthand) = (None, None)
        if (ast is None):
            signode = addnodes.desc_signature(sig, '')
            signode.clear()
            signode += addnodes.desc_name(sig, sig)
            node.replace_self(signode)
            continue
        rootSymbol = self.env.domains['cpp'].data['root_symbol']
        parentSymbol = rootSymbol.direct_lookup(parentKey)
        if (not parentSymbol):
            print('Target: ', sig)
            print('ParentKey: ', parentKey)
            print(rootSymbol.dump(1))
        assert parentSymbol
        symbols = []
        if isShorthand:
            assert isinstance(ast, ASTNamespace)
            ns = ast
            name = ns.nestedName
            if ns.templatePrefix:
                templateDecls = ns.templatePrefix.templates
            else:
                templateDecls = []
            (symbols, failReason) = parentSymbol.find_name(nestedName=name, templateDecls=templateDecls, typ='any', templateShorthand=True, matchSelf=True, recurseInAnon=True, searchInSiblings=False)
            if (symbols is None):
                symbols = []
        else:
            assert isinstance(ast, ASTDeclaration)
            decl = ast
            name = decl.name
            s = parentSymbol.find_declaration(decl, 'any', templateShorthand=True, matchSelf=True, recurseInAnon=True)
            if (s is not None):
                symbols.append(s)
        symbols = [s for s in symbols if (s.declaration is not None)]
        if (len(symbols) == 0):
            signode = addnodes.desc_signature(sig, '')
            node.append(signode)
            signode.clear()
            signode += addnodes.desc_name(sig, sig)
            logger.warning(("Could not find C++ declaration for alias '%s'." % ast), location=node)
            node.replace_self(signode)
        else:
            nodes = []
            options = dict()
            options['tparam-line-spec'] = False
            for s in symbols:
                signode = addnodes.desc_signature(sig, '')
                nodes.append(signode)
                s.declaration.describe_signature(signode, 'markName', self.env, options)
            node.replace_self(nodes)
def apply(self, **kwargs: Any) -> None:
    for node in self.document.traverse(AliasNode):
        sig = node.sig
        parentKey = node.parentKey
        try:
            parser = DefinitionParser(sig, location=node, config=self.env.config)
            (ast, isShorthand) = parser.parse_xref_object()
            parser.assert_end()
        except DefinitionError as e:
            logger.warning(e, location=node)
            (ast, isShorthand) = (None, None)
        if (ast is None):
            signode = addnodes.desc_signature(sig, )
            signode.clear()
            signode += addnodes.desc_name(sig, sig)
            node.replace_self(signode)
            continue
        rootSymbol = self.env.domains['cpp'].data['root_symbol']
        parentSymbol = rootSymbol.direct_lookup(parentKey)
        if (not parentSymbol):
            print('Target: ', sig)
            print('ParentKey: ', parentKey)
            print(rootSymbol.dump(1))
        assert parentSymbol
        symbols = []
        if isShorthand:
            assert isinstance(ast, ASTNamespace)
            ns = ast
            name = ns.nestedName
            if ns.templatePrefix:
                templateDecls = ns.templatePrefix.templates
            else:
                templateDecls = []
            (symbols, failReason) = parentSymbol.find_name(nestedName=name, templateDecls=templateDecls, typ='any', templateShorthand=True, matchSelf=True, recurseInAnon=True, searchInSiblings=False)
            if (symbols is None):
                symbols = []
        else:
            assert isinstance(ast, ASTDeclaration)
            decl = ast
            name = decl.name
            s = parentSymbol.find_declaration(decl, 'any', templateShorthand=True, matchSelf=True, recurseInAnon=True)
            if (s is not None):
                symbols.append(s)
        symbols = [s for s in symbols if (s.declaration is not None)]
        if (len(symbols) == 0):
            signode = addnodes.desc_signature(sig, )
            node.append(signode)
            signode.clear()
            signode += addnodes.desc_name(sig, sig)
            logger.warning(("Could not find C++ declaration for alias '%s'." % ast), location=node)
            node.replace_self(signode)
        else:
            nodes = []
            options = dict()
            options['tparam-line-spec'] = False
            for s in symbols:
                signode = addnodes.desc_signature(sig, )
                nodes.append(signode)
                s.declaration.describe_signature(signode, 'markName', self.env, options)
            node.replace_self(nodes)