You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
It should be possible to have a type with the same name as a struct/union/enum, as in the language.
To Reproduce
Steps to reproduce the behavior: as example, consider the following documentation (where every instance of struct could be replaced with union or enum instead):
.. c:struct:: foo
.. c:type::struct foo foo
No duplicate declaration warning.
- :c:struct::`foo`, link to the struct.
- :c:type::``foo``, link to the typedef.
- :c:any:``foo``, probably link to the type?
- Perhaps new feature: :c:any:``struct foo``, link to the struct.
- :c:expr:``foo*``, hyperlink ``foo`` to the typedef.
- c:expr:``struct foo*``, hyperlink ``foo`` (or all of ``struct foo``?) to the struct.
Hi. I reported this over at the Breathe site. Attached is a test-case that shows the problem. I've got four cases:
A C struct where the typedef and struct have the same name (processed via Doxygen and Breathe)
A C struct where the typedef and the struct have different names (processed via Doxygen and Breathe)
Sphinx markup declaring a C type and struct with the same name
Sphinx markup declaring a C type and struct with different names
Cases 2 and 4 work correctly - I can link to the types or the structs.
Cases 1 and 3 are broken - trying to reference the struct results in a link to the typedef.
I don't know what the cause is, but I did notice that the URLs for the links don't include the full domain. They are of the form .../html/foo.html/#c.foo_t. The top-level domain (:c:) is present, but the next-level domain (:type: or :struct:) is not, making it impossible to distinguish between the two.
(Just to avoid nomenclature confusion: "domain" in Sphinx means something specific, so for example "c", "cpp", and "python" are domains, without further subdivision.)
The cause is relatively simple: the C domain keeps track of declarations without partitioning names into tag and non-tag names. The links include an ID generated by the C domain (if you try other domains you will see very different patterns for the IDs), and you are absolutely correct that the ID needs to include tagging.
Describe the bug
It should be possible to have a type with the same name as a struct/union/enum, as in the language.
To Reproduce
Steps to reproduce the behavior: as example, consider the following documentation (where every instance of
struct
could be replaced withunion
orenum
instead):Expected behavior
See above.
Additional context
The text was updated successfully, but these errors were encountered: