Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(C++) Qualified names in signatures fail to generate cross-references #12845

Open
vector-of-bool opened this issue Aug 29, 2024 · 0 comments
Open

Comments

@vector-of-bool
Copy link

Describe the bug

If a C++ function parameter or return type contains a qualified name, then xref resolution fails by attempting to generate a link for the namespace name.

Given

.. cpp:namespace:: foo
.. cpp:class:: something 

.. cpp:function:: void bar(foo::something arg)

Expected: The foo::something parameter type generates a hyperlink to the something class defined within the foo namespace.

Actual: /.../repro/index.rst:8: WARNING: cpp:identifier reference target not found: foo [ref.identifier]

Using a qualified name in an inline reference (e.g. cpp:class or cpp:any) will resolve the object just fine. It appears that the generated signature nodes contain a reference to some foo (the namespace), which has no link target.

This usually will silently fail unless nitpicky mode is enabled.

How to Reproduce

An empty conf.py is sufficient. The following index.rst will fail to render when nitpicky-mode is enabled:

.. default-domain:: cpp
.. namespace:: foo
.. class:: something

.. function:: void bar(foo::something)

Environment Information

Platform:              linux; (Linux-6.10.3-arch1-2-x86_64-with-glibc2.40)
Python version:        3.12.4 (main, Jun  7 2024, 06:33:07) [GCC 14.1.1 20240522])
Python implementation: CPython
Sphinx version:        8.0.2
Docutils version:      0.21.2
Jinja2 version:        3.1.4
Pygments version:      2.18.0

Sphinx extensions

No response

Additional context

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants