GNOME Bugzilla – Bug 614465
\relates confused on multiple static functions with the same name.
Last modified: 2018-07-30 10:46:34 UTC
If you have static functions in different cpp files for different classes that have the same name and you try to \relates them to their respective classes, they all get lumped together on a single class. I would expect that the function to appear with the class they \relates to. The following example illustrates the problem: doxy_errA.cpp -------- class ClassA{}; // normally included from a header //! \relates ClassA static void Function() { } doxy_errB.cpp -------- class ClassB{}; // normally from a header //! \relates ClassB static void Function() { } If doxy_errA.cpp and doxy_errB.cpp are included via the doxy wizard in the following order: doxy_errA.cpp doxy_errB.cpp The documentation for Function() all ends up associated with ClassA. If you reverse the order of the files so that doxy_errB.cpp is first, the association switches to ClassB The doxy docs generated are as follows (pasted HTML converted to text): --------------------------------- ClassA Class Reference List of all members. Related Functions (Note that these are not member functions.) static void Function () Detailed Description Definition at line 2 of file doxy_errA.cpp. Friends And Related Function Documentation static void Function ( ) [related] Definition at line 5 of file doxy_errA.cpp. 00006 { 00007 } The documentation for this class was generated from the following files: * T:/doxy_errA.cpp * T:/doxy_errB.cpp --------------------------------- My style is to use static non-member functions for small helper functions instead of static private members whenever possible. This limits pollution of the class definition with private details. Given the tight coupling to the class, I \relates them to the class. I tend to name these functions similarly if they do similar jobs. Particularly in the case of a number of classes derived from the same base, it is likely that these static helpers end up with the same name and signature. Since this style is pervasive in our code base, I am seeing this bug a lot as we start to Doxify our code. I have not looked carefully enough to see if this problem also occurs when the signature is different.
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!