sphinx-doc / sphinx-doc/sphinx
C++, type lookup in function with parameter of same name
Open
@jakobandersen is already working on this.
Since May 28, 2020.
domains:cpp
type:bug
- Dominant language
- Python
- Stars
- 8k
- Forks
- 2.6k
- PR merge metrics
- No merged PRs in 30d
Description
Describe the bug
When the same name is used for a function parameter as for a type used in the same declaration,
then the type sometimes gets linked to the wrong thing.
To Reproduce
Steps to reproduce the behavior:
.. cpp:struct:: abc::something
.. cpp:var:: int x
.. cpp:struct:: abc::otherthing
.. cpp:function:: otherthing(const something &something)
The ``something`` type gets linked to the ``something`` variable,
instead of the ``something`` class.
Expected behavior
When making cross-reference in function declarations the lookup should take the relative position inside the declaration into account.
Environment info
Any Sphinx version.
Additional context
See michaeljones/breathe#536.
Also, the C domain probably has the same bug.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.