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
typedef of a function incorrectly output in HTML and PDF #10295
Comments
@albert-github Thanks for reading and for classifying it as a bug. |
This is also listed as known problem here (see bullet starting with "Redundant braces can confuse doxygen in some cases"). Probably in this particular case something is possible, but it is a very hard problem in the general case without proper type analysis which doxygen does not do (and often cannot do in case the input is incomplete). |
@Albrecht-S Please verify if the referenced commit fixes the issues you found. Do not close the issue, this will be done automatically when the next official version is released. |
@doxygen Yep, current master (tested: c29b0e6) works as expected. From my POV this issue is fixed. Suggestion: please check if the related issues in my original post are fixed as well and close if appropriate. Thank you very, very much for the quick fix. Current master also fixes the following /** more complicated typedef's. */
typedef int int_t, *intp_t, (&fp)(int, long), arr1_t[10]; Since the fix is in |
This is correct |
Good suggestion to check the related issues:
|
This issue was previously marked 'fixed but not released', |
@doxygen I confirm that my issue is fixed in 1.10.0 (self-built from Git tag Thanks for fixing it. |
Describe the bug
The following C++ code
generates the wrong output:
Note the extraneous
()
afterint
.A function typedef w/o
()
, for instancetypedef int Int_Function2(int, int);
works as expected. This could be used as a workaround but that wouldn't solve the issue. The project I'm working on has lots of typedef's using the former syntax.Expected behavior
Output should be
Screenshots
Please see PDF file with more comments:
Function_Typedef.pdf
To Reproduce
Self contained example:
typedef.tar.gz
Version
This issue is visible in doxygen 1.10.0, self-built from git master, commit a3cba26, but also in earlier releases. I don't think it's a regression in recent releases (but I may be wrong with this).
Platform: Linux, Debian 12 (Bookworm), included system doxygen version is 1.9.4.
Tested also with doxygen 1.8.14 (same effect).
Additional context
Related issues: #10136, #9944, #7060. All these seem to indicate problems parsing typedefs, particularly function typedefs with redundant
()
as in my example. I went back until about July 2018 to find similar issues (found these three mentioned issues).The example posted above uses by default the smallest code to show the issue with (a) correct and (b) failing typedef. Both syntax variants are IMHO legit.
I found even more issues when I used different typedef's, some from the cppref site (see included example code). You can enable more examples by setting the macro
MORE_EXAMPLES
to1
as indicated in the included source filetest1.cxx
. One of the examples from cppref uses a comma-separated list of typedef's that shows even more - only loosely related - issues (incorrect type propagation from one element of the list to later elements). I wanted to mention these here since I found these issues and they seem to be related.Thanks for this great tool and I appreciate the work all devs are putting into it.
The text was updated successfully, but these errors were encountered: