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

Template parameter declarations repeated #81

Closed
taehyounpark opened this issue Nov 10, 2023 · 5 comments · Fixed by #95
Closed

Template parameter declarations repeated #81

taehyounpark opened this issue Nov 10, 2023 · 5 comments · Fixed by #95
Labels
bug Something isn't working

Comments

@taehyounpark
Copy link

As seen here, the declaration of a template parameter class delayed<Bkr> receives a repeated declaration template <typename Bkr typename Bkr>

The xml output from Doxygen does not contain this, so I'm not sure what (if anything) can be done from the user-side to "guide" this prevent this, or if it would need a fix. Thank you in advance!

@bsadri
Copy link

bsadri commented Jan 2, 2024

I have the same problem.

@JakubAndrysek JakubAndrysek added the bug Something isn't working label Feb 1, 2024
@r-braun
Copy link
Contributor

r-braun commented Mar 20, 2024

I also have this problem and after some testing I noticed that it only happens with simple template paramters (Constrained or variadic parameters work correctly).

I think this is a result of doxygen generating different xml structures for them (maybe a doxygen bug?).

Take the following c++ code for example:

template <typename TypeName, class Class, std::integral Integral, class... Variadic>
struct TemplateTest {};

The templateparamlist generated by doxygen (tested with Version 1.9.4 and 1.10.0) looks as follows:

<templateparamlist>
    <param>
        <type>typename TypeName</type>
    </param>
    <param>
        <type>class Class</type>
    </param>
    <param>
        <type>std::integral</type>
        <declname>Integral</declname>
        <defname>Integral</defname>
    </param>
    <param>
        <type>class...</type>
        <declname>Variadic</declname>
        <defname>Variadic</defname>
    </param>
</templateparamlist>

As you can see, in the case of typename/class the whole declaration is inside type. But for the constrained or variadic case, the declaration is split into type and declname/defname.

@taehyounpark
Copy link
Author

taehyounpark commented Mar 30, 2024

@r-braun I was looking into whether this is an issue with other doc generators, and nested/variadic templates are generally very finicky with the majority of them. Even a seemingly widely-used workflow like readthedocs+sphinx gets it wrong. What does work, is m.css. I am not nearly familiar enough with Doxygen's XML structure to know what's going on, but there does seem to be some extra handling based on type vs. declname tags in their source code. It would seem that if this is really what doxygen intends, it does need some massaging by downstream clients.

@r-braun
Copy link
Contributor

r-braun commented Apr 2, 2024

@taehyounpark That's the impression I got as well and from what I've seen in the source code here, there's already some massaging done. I created a PR (#95) that fixes the issue for all of my use cases, but I'm also no doxygen specialist so I can't guarantee there aren't some edge cases left.

@JakubAndrysek
Copy link
Owner

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants