code: def test_domain_cpp_ast_nested_name():
      check("class", "{key}::A", {1: "A", 2: "1A"})
      check("class", "{key}::A::B", {1: "A::B", 2: "N1A1BE"})
      check("function", "void f(::A a)", {1: "f__A", 2: "1f1A"})
      check(
          "function", "void f(::A::B a)", {1: "f__A::B", 2: "1fN1A1BE"}
      )
  
imports: import itertools
  import re
  import zlib
  import pytest
  import sphinx.domains.cpp
  from sphinx import addnodes
  from sphinx.addnodes import desc, desc_content, desc_name, desc_parameter, desc_parameterlist, desc_sig_name, desc_sig_space, desc_signature, desc_signature_line, pending_xref
  from sphinx.domains.cpp import DefinitionError, DefinitionParser, NoOldIdError, Symbol, _id_prefix, _max_id
  from sphinx.ext.intersphinx import load_mappings, normalize_intersphinx_mapping
  from sphinx.testing import restructuredtext
  from sphinx.testing.util import assert_node
  from sphinx.writers.text import STDINDENT
label_desc: Use image node_id 11 for calling a global function with example usage: test_domain_cpp_ast_nested_name() without return types