Fix linking to strong enum values from tagfiles if they're inside a class or namespace #11137
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The refactor in 35711f2 (part of 1.9.5) lost this particular bit, causing the code to be only able to link to enum values from tagfiles where the enum was in global scope, not in any subnamespace.
Expanded the strong enums test with various possible combinations to ensure this doesn't regress again. In particular, without the change in
doxygen.cpp
, the following warnings are produced:In particular, linking to the enum did work, but to its values not, only if the enum itself was in global scope. The tagfile is hand-crafted to make visual verification of the XML output easier, hopefully there aren't any serious errors.
For some reason the CI test doesn't want to pick up the referenced tagfile, not sure why... Also, If I'm abusing a wrong test case for this, let me know -- I can separate that into a new one.
Note: I did not handle the case of linking to weak enum values by prefixing them with the enum, i.e.
@ref WeakEnum::WeakEnumFlag
,@ref ExternalWeakEnum::ExternalWeakEnumFlag
etc. For locally defined enums this works, but for the tagfile it doesn't, as the tagfile doesn't preserve any relation between the enum and the value. (And to my knowledge it never did.) Which means it isn't really a regression that needs a fix, and I'm fine with this part not working.