Skip to content

doxygen gets confused with duplicate class definitions and recursion detection #10165

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

Closed
PlasmaHH opened this issue Jul 3, 2023 · 5 comments
Closed

Comments

@PlasmaHH
Copy link

PlasmaHH commented Jul 3, 2023

Describe the bug
When two files in the project contain the same two classes deriving in the same way, doxygen issues a "Detected potential recursive class relation between class B and base class A" warning

Expected behavior
No such warning

To Reproduce
Put the following code into two header files:

class A {};
class B : A{};

Version
1.9.7

Additional context
This can happen in real world projects where you have different implementations under the same class hierarchy. This is probably causes by a fix to bug 690787 (#5005) which detects something similar.

It seems to be that the check at doxygen.cpp:4553 i.e.

if (!cd->isSubClass(baseClass) && cd!=baseClass && cd->isBaseClass(baseClass,true,templSpec)==0) // check for re        cursion, see bug690787

gets confused when the names have been encountered in a previous run already...

@albert-github albert-github changed the title doxygen gests confused with duplicate class definitions and recursion detection doxygen gets confused with duplicate class definitions and recursion detection Jul 3, 2023
@albert-github
Copy link
Collaborator

Some bisecting, looks like the problem is introduced with:

57f5ad207379b49246493850269bc8be49fa95ff is the first bad commit
commit 57f5ad207379b49246493850269bc8be49fa95ff
Date:   Fri Dec 9 19:27:50 2022 +0100

    issue #9715: segmentation fault (recursive classes?)

 src/doxygen.cpp | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

but that also the extra fix:

Commit: f502b1932177fec9c7d424f43415c8b861112da2 [f502b19]
Date: Tuesday, December 13, 2022 9:40:40 PM
issue #9720: Recursive class relation warning when using type aliases starting with 57f5ad2

does not solve this problem.

doxygen added a commit that referenced this issue Jul 30, 2023
@doxygen
Copy link
Owner

doxygen commented Jul 30, 2023

@PlasmaHH Can you please verify if the referenced commit fixes the problem for you? Please do not close the issue, as this will be done automatically when the next official release is made available.

@PlasmaHH
Copy link
Author

@doxygen It fixes the problem for my local testcase. I cannot tell yet if it does for the whole production codebase as I am on vacation and will be back in a bit more than 2 weeks, but from my slightly more complicated testcase condensed from production code that I have with me it looks fine.

(btw. I noticed that doxygen build from that git commit crashes for me after main exit when built with use_libclang, known issue or worth a bugreport?)

@albert-github
Copy link
Collaborator

Worth a bug report.

@albert-github albert-github added the fixed but not released Bug is fixed in github, but still needs to make its way to an official release label Jul 30, 2023
@doxygen
Copy link
Owner

doxygen commented Aug 25, 2023

This issue was previously marked 'fixed but not released',
which means it should be fixed in doxygen version 1.9.8.
Please verify if this is indeed the case. Reopen the
issue if you think it is not fixed and please include any additional information
that you think can be relevant (preferably in the form of a self-contained example).

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

4 participants
@doxygen @PlasmaHH @albert-github and others