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

Classes not being added to groups #8638

Closed
jwakely opened this issue Jul 1, 2021 · 13 comments
Closed

Classes not being added to groups #8638

jwakely opened this issue Jul 1, 2021 · 13 comments

Comments

@jwakely
Copy link
Contributor

jwakely commented Jul 1, 2021

Describe the bug

C++ classes are sometimes not documented under the "module" that they are added to by using grouping commands such as \defgroup or \addtogroup or explicit \ingroup commands.

Expected behavior

In the attached reproducer, the std::bad_exception and std::system_error classes should be in the "Exceptions" module. The std::error_code and std::error_condition classes should be in the Diagnostics module. They are all documented (you can find them in the Class Index) but they are not grouped where they should be.

To Reproduce

doxygen-groups-bug.tar.gz

Extract attached tarball, then run doxygen

Version

1.9.1

LSB Version: :core-4.1-amd64:core-4.1-noarch
Distributor ID: Fedora
Description: Fedora release 34 (Thirty Four)
Release: 34
Codename: ThirtyFour

Using the default Fedora package, doxygen-1.9.1-10.fc34.x86_64

@jwakely
Copy link
Contributor Author

jwakely commented Jul 1, 2021

This is causing bugs in the docs for libstdc++ as noted at gcc-mirror/gcc@6963c3b

Some classes that are defined in <type_traits> are correctly grouped, but a large number are not, and so don't appear in the relevant part of the docs. The only way to find them is the class index.

@jwakely
Copy link
Contributor Author

jwakely commented Jul 1, 2021

It seems that adding @class foo to the comment block for class foo causes it to be correctly added to the group.

I don't know why that makes any difference, Doxygen is clearly able to tell that the comment block is for that class, because it puts the text on the page for the class. But if I tell it what it already knows, then this bug goes away.

@CambridgeDave
Copy link

Using the example from the documentation on grouping, I find that adding any non-whitespace content to a class stops it from being included in the group:

/** @defgroup group1 The First Group
 *  This is the first group
 *  @{
 */
 
/** @brief class C1 in group 1 - *is* documented in the group */
class C1 {};
 
/** @brief class C2 in group 1 - *is not* documented in the group */
class C2 { /* This added */ };
 
/** @} */ // end of group1

This behaviour started with v1.8.17.

@albert-github
Copy link
Collaborator

@CambridgeDave

I tried the code you supplied with the 1.8.16, 1.8.17 and 1.9.1 versions of doxygen and the configuration file from the group example, but I don't see a difference. What did I oversee? (maybe enlighten with some images?)

Also (always): Can you please attach a, small, self contained example (source+configuration file in a tar or zip) that allows us to reproduce the problem? Please don't add external links as they might not be persistent.

@albert-github
Copy link
Collaborator

@jwakely
I tried the example with the 1.9.1 version and with the current master (1.9.2 (97dffa0)

For the Diagnostics and 1.9.1 I see (file html/a00023.html):
image

For the Diagnostics and master I see (file html/a00023.html):
image

For the Exceptions and 1.9.1 I see (file html/a00026.html):
image
(so no classes at all).

For the Exceptions and master I see (file html/a00026.html):
image

Are these the problems you meant?

@albert-github albert-github added bug C/C++ needinfo reported bug is incomplete, please add additional info labels Jul 20, 2021
@jwakely
Copy link
Contributor Author

jwakely commented Jul 20, 2021

@albert-github yes I can confirm the same results (I have a master build now, which I didn't have when I reported this). So it seems to be fixed on master, that's good.

Is the root cause of the bug understood? Is the commit that fixed it known, so I can look into backporting it to the Fedora RPMs? Are there tests to prevent regressions?

@albert-github albert-github added fixed but not released Bug is fixed in github, but still needs to make its way to an official release and removed needinfo reported bug is incomplete, please add additional info labels Jul 20, 2021
@albert-github
Copy link
Collaborator

albert-github commented Jul 20, 2021

Setting the issue to fixed but not released.

  • Is the root cause of the bug understood? Is the commit that fixed it known, so I can look into backporting it to the Fedora RPMs?
    The first commit that the problem is fixed is (as far as I can see):
    Commit: b3cefe5954ed37ebcf843eced45e878b7b3dddcc [b3cefe5]
    Date: Thursday, February 4, 2021 9:11:15 PM
    
    issue #8371: @defgroup contained in the markdown mainpage.md are not including the @ingroup marked classes in the generated documentation.
    
    (looks like an unrelated problem to @defgroup contained in the markdown mainpage.md are not including the @ingroup marked classes in the generated documentation. #8371 but it is not. Both issues used the \defgroup in combination with the \ingroup).
    My personal opinion: Regarding backporting, not really advised as at that moment it will be very hard to compare results in case of problems.
  • Are there tests to prevent regressions?
    Not that I know of, feel free to create a test in the testing directory of doxygen.

@CambridgeDave
Copy link

@albert-github

I tried the code you supplied with the 1.8.16, 1.8.17 and 1.9.1 versions of doxygen and the configuration file from the group example, but I don't see a difference. What did I oversee? (maybe enlighten with some images?)

Thanks for looking at it.

I'm now worried mine is a separate issue, and I'm muddying the waters, but here is a tiny example that reproduces the problem.

DoxygenGroupTest.tar.gz

Importantly, it looks like this only happens if GROUP_NESTED_COMPOUNDS = YES in the configuration.

@albert-github
Copy link
Collaborator

At first glance it does look like muddying the waters, though:

With 1.8.16 I see:
image

With 1.9.1 I see:
image

with the current master(1.9.2 (97dffa0)) I see again:
image

Also in this case the fix is by the

Commit: b3cefe5954ed37ebcf843eced45e878b7b3dddcc [b3cefe5]
Date: Thursday, February 4, 2021 9:11:15 PM

issue #8371: @defgroup contained in the markdown mainpage.md are not including the @ingroup marked classes in the generated documentation.

so there was no muddying, but it was helpful that it was with this issue...

@CambridgeDave
Copy link

Good news! I'll build from source for now, then. Cheers!

@jwakely
Copy link
Contributor Author

jwakely commented Jul 20, 2021

@albert-github

My personal opinion: Regarding backporting, not really advised as at that moment it will be very hard to compare results in case of problems.

Understood. Thanks for the commit ID.

@doxygen
Copy link
Owner

doxygen commented Aug 18, 2021

This issue was previously marked 'fixed but not released',
which means it should be fixed in doxygen version 1.9.2.
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).

@doxygen doxygen removed the fixed but not released Bug is fixed in github, but still needs to make its way to an official release label Aug 18, 2021
@doxygen doxygen closed this as completed Aug 18, 2021
@jwakely
Copy link
Contributor Author

jwakely commented May 11, 2022

The first commit that the problem is fixed is (as far as I can see):
```
Commit: b3cefe5 [b3cefe5]
Date: Thursday, February 4, 2021 9:11:15 PM

  issue #8371: @defgroup contained in the markdown mainpage.md are not including the @ingroup marked classes in the generated documentation.
  ```
  (looks like an unrelated problem to [@defgroup contained in the markdown mainpage.md are not including the @ingroup marked classes in the generated documentation. #8371](https://github.com/doxygen/doxygen/issues/8371) but it is not. Both issues used the `\defgroup` in combination with the `\ingroup`).

I bisected it and confirmed that b3cefe5 fixed my issue.

I also determined that my issue only happened with GROUP_NESTED_COMPOUNDS=YES even though the classes that were missing from the group were not nested classes so should not have been affected by that option.

hubot pushed a commit to gcc-mirror/gcc that referenced this issue Mar 18, 2024
Before Doxygen version 1.9.2 this option is broken (see
doxygen/doxygen#8638 for more details) and
classes are not added to the correct groups by @InGroup and @addtogroup.

Also remove the obsolete CLASS_DIAGRAMS option that causes a warning.

libstdc++-v3/ChangeLog:

	* doc/doxygen/user.cfg.in (GROUP_NESTED_COMPOUNDS): Set to NO.
	(CLASS_DIAGRAMS): Remove obsolete option.

(cherry picked from commit 9c3a8fe)
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