GNOME Bugzilla – Bug 389656
Enumerations having some identical member names are confused.
Last modified: 2018-07-30 10:24:32 UTC
Please describe the problem: This applies to Csharp (C#) code documentation of enumerations (enum). When two enumerations share some members having the same name, documentation for both members appears with both enumeration documentations. PLEASE SEE SIMPLE EXAMPLE IN OTHER INFORMATION BELOW. Steps to reproduce: 1. Create a C# program with two global enumerations (not nested in a class, but can be in a namespace) and nothing else. 2. Make some of the members of the enumerations have the same names. 3. Run doxygen with enough flags set so you get enums documented. Actual results: You get duplicate entries in the documentation. One for the member that is actually in the enumeration, another for the member with the same name in the other enumeration. Expected results: Only members of an enumeration should be documented with the enumeration. Documentation should not include members of other enumerations. Does this happen every time? Yes Other information: ----------------------------------------------- This is the sample program ----------------------------------------------- using System; /// <summary> /// This is an enumeration. /// </summary> public enum List1 { Folder, //!< This is item 1 in enumeration 1 Compilation, //!< This is item 2 in enumeration 1 Directory, //!< This is item 3 in enumeration 1 Label //!< This is item 4 in enumeration 1 } /// <summary> /// This is another enumeration. /// </summary> public enum List2 { Horse, //!< This is item 1 in enumeration 2 Compilation, //!< This is item 2 in enumeration 2 Dog, //!< This is item 3 in enumeration 2 Label, //!< This is item 4 in enumeration 2 Cat //!< This is item 5 in enumeration 2 } --------------------------------------- This is some of the documentation (a CHM file) --------------------------------------- enum List1 This is an enumeration. Enumerator: Folder This is item 1 in enumeration 1. Compilation This is item 2 in enumeration 1. Compilation This is item 2 in enumeration 2. Directory This is item 3 in enumeration 1. Label This is item 4 in enumeration 1. Label This is item 4 in enumeration 2. Definition at line 6 of file sample.cs. enum List2 This is another enumeration. Enumerator: Horse This is item 1 in enumeration 2. Compilation This is item 2 in enumeration 1. Compilation This is item 2 in enumeration 2. Dog This is item 3 in enumeration 2. Label This is item 4 in enumeration 1. Label This is item 4 in enumeration 2. Cat This is item 5 in enumeration 2. Definition at line 17 of file sample.cs.
Confirmed. This is due to the difference in the way enum values are handled in C# and C++. In C++ enum values are accessible outside the enums scope, where-as in C# they require explicit qualification. I'll add some specific treatment for C# in the next CVS update, so the output is at least correct in both cases.
The exact same problem occurs in D. Will the solution you have in mind break documentation in languages other than C# and D? Otherwise, I don't see any need for language-specific treatment rather than putting it into the basic algorithm.
This bug was marked "assigned" by me some time ago, which means it should be fixed in version 1.5.2 and is hereby marked as such. I would kindly request you to check if this version indeed fixes the problem and reopen the bug report should you still see the same problem.
The bug is still there. Please reopen.
Created attachment 96289 [details] D testcase
Problem is in 1.8.3.1 (20130512 / svn 848) still present for the language D; for c# the problem is not present anymore.
As discussed in https://github.com/doxygen/doxygen/pull/734 , Doxygen has moved its issue tracking to https://github.com/doxygen/doxygen/issues All Doxygen tickets in GNOME Bugzilla have been migrated to Github. You can subscribe and participate in the new ticket in Github. You can find the corresponding Github ticket by searching for its Bugzilla ID (number) in Github. Hence I am closing this GNOME Bugzilla ticket. Please use the corresponding ticket in Github instead. Thanks a lot!