bug_705285 Allow non-globally unique page/section labels when using tagfiles
The basic idea is that occurrences in the "normal" files are preferred above occurrences in a tag file
To be able to do this there should also be a mechanism to refer (by means of \ref) to a page section in the project that is "linked" by means of a tag file.
- define a tag and store this in the tag file (doxygen.cpp extend
GENERATE_TAGFILEwith the possibility to specify a tag), read the tag back when reading the tag file (tagreader.cpp) and adjust the checking of theGENERATE_TAGFILE(configimpl.l) - extend the reading of the
\refcommand to support a tag, this is done by means of having{<tag>}<ref_word>(doctokenizer.l) - adjusting page names (to be used in
\ref) when read pages from a tag file, in this way the page could be accessed by means of the original name or the adjusted name with the tag, also the section names should be adjusted (otherwise there could be double section names) (tagreader.cpp).- when there is a page in the main part of the documentation (so not linked through a tag file) and the page name is defined here it should not be in present from the tag file (these tagged pages are still accessible through the version with the tag name though), (doxygen.cpp with getPageDoc and checkRemovePageDoc).
- when a page is present in multiple tag files this is not unique and should be removed (these tagged pages are still accessible through the version with the tag name though) (doxygen.cpp getPageDocTag, countPageDocTag and checkRemovePageDoc).
- when there are section names that occur in multiple tag files the names of the second and subsequent occurrences are not recorded, so always the first one is used. To prevent this these names are stored and after the tag file reading and reading of the "normal" files these section names are removed (Note 1) that a maximum of 1 occurrence can remain as read from tag files, 2) in case the name also occurs in the "normal" files this occurrence overwrites the possible present version from the tag files, commentscan.l. 3) in case of the an occurrence in multiple tag files a warning could be given, now suppressed, but I think in that case it should be suppressed by means of a Doxyfile setting). (tagreader.cpp and section.h)
Kudos, SonarCloud Quality Gate passed! 
0 Bugs
0 Vulnerabilities
0 Security Hotspots
19 Code Smells
No Coverage information
0.0% Duplication
@albert-github I was looking at this change, and I'm trying to understand the requirements behind it.
Let me summarize it to see if I got it correctly:
Given some input files and a set of tag files.
- When label
xis present in the input and also imported via a tag file,\ref xshall point to the input (a local label has preference over an imported label). - To explicitly link to a label imported from a tag file
\ref {tag}xshall be used (wheretaguniquely identifies the tag file). - When a label
yis unique (when combining input and tag files) and defined in a tag filetag, the explicit tag can be omitted, i.e. both\ref yand\ref {tag}yare equally valid and point to the tag file (needed for ease of use and backward compatibility). - When a label
xis defined in multiple tag files, but not in the input, it shall have an explicit reference, i.e.\ref {tag1}xor\ref {tag2}xare valid and\ref xshall produce an ambiguity warning (we could still link to one of tag files for backward compatibility).
@doxygen that is indeed the intention.