After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 318061 - Template functions with the same signature belonging to templates with different template arguments must be considered different functions
Template functions with the same signature belonging to templates with differ...
Status: RESOLVED FIXED
Product: doxygen
Classification: Other
Component: general
1.4.x
Other Linux
: Normal normal
: ---
Assigned To: Dimitri van Heesch
Dimitri van Heesch
Depends on:
Blocks:
 
 
Reported: 2005-10-05 22:16 UTC by cruff
Modified: 2011-08-14 14:04 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
screenshot of documentation produced by 1.6.0 (74.06 KB, image/png)
2009-08-20 11:14 UTC, Leon
Details
Header file from which documenation was created (7.10 KB, text/plain)
2009-08-20 11:15 UTC, Leon
Details
Configuration file (59.21 KB, application/octet-stream)
2009-08-20 11:16 UTC, Leon
Details
Layout file (5.53 KB, text/xml)
2009-08-20 11:16 UTC, Leon
Details
source file for XML test case (243 bytes, text/x-c++src)
2011-05-01 22:12 UTC, Jim Bosch
Details
configuration file for XML test case (with ambiguous.cc) (70.59 KB, application/octet-stream)
2011-05-01 22:13 UTC, Jim Bosch
Details

Description cruff 2005-10-05 22:16:32 UTC
Version details: 1.4.5

/*!
 *@file t.cc
 */

/*!
 *@brief template A
 */
template <class T, class C, T C::*pm>
inline bool
Set(void* p, T& r)
{
        static_cast<C*>(p)->*pm = r;
        return(true);
}

/*!
 *@brief template B
 */
template <class T, class C, T C::*pm, bool C::*pb>
inline bool
Set(void* p, T& r)
{
        C*      o = static_cast<C*>(p);

        o->*pm = r;
        o->*pb = true;
        return(true);
}
Comment 1 kuodo 2006-02-14 17:45:16 UTC
I have the same problem, with 1.4.6.
Another example, I hope it helps:

///i am documented
template<class T>
 static void bug(T);
	
///i am ignored, with a warning
template<int I, class T>
 static void bug(T);
Comment 2 Leon 2009-06-07 18:20:33 UTC
I can confirm this problem with doxygen 1.5.9 on Windows. Although both functin templates are documented (in my case with more than just \brief part), Doxygen will generate only the entry for the first function template, but will merge the documentation texts (except for \brief section) from both function templates.

It is not often that you have to write such templates, and it is nothing like critical issue, still I was surprised that it has been unconfirmed that long.

Comment 3 Dimitri van Heesch 2009-07-18 21:42:45 UTC
Confirmed. Should be fixed in the next subversion update.
Comment 4 Dimitri van Heesch 2009-08-20 10:12:53 UTC
This bug was previously marked ASSIGNED, which means it should be fixed in
doxygen version 1.6.0. Please verify if this is indeed the case and reopen the
bug if you think it is not fixed (include any additional information that you
think can be relevant).
Comment 5 Leon 2009-08-20 11:13:34 UTC
Either I am not permitted to reopen the bug, or I just failed to see how to do it.

In any case, 1.6.0 version (MS Windows setup exe) I just fetched from Doxygen download page does not appear to fix this bug. I will be attaching the screenshot of the produced (HTML) documentation and barebone example files used to produce it (header file, config file and layout file).

It is my claim that the example documentation should list separate entries for two static_pointer_cast function templates, as they are different - the first accepts three template parameters and the second accepts four. As such those are different templates.

The behavior of 1.6.0 does differ from 1.5.9 I used previously - in 1.6.0 the documentation of both function templates is no longer merged, but ignored.
Comment 6 Leon 2009-08-20 11:14:33 UTC
Created attachment 141234 [details]
screenshot of documentation produced by 1.6.0
Comment 7 Leon 2009-08-20 11:15:42 UTC
Created attachment 141235 [details]
Header file from which documenation was created
Comment 8 Leon 2009-08-20 11:16:15 UTC
Created attachment 141236 [details]
Configuration file
Comment 9 Leon 2009-08-20 11:16:38 UTC
Created attachment 141237 [details]
Layout file
Comment 10 Jim Bosch 2011-05-01 07:26:01 UTC
I've encountered this problem as well, using the latest released version (1.7.4).  Looking at the XML output, the problem appears to be that the IDs for the functions are the same, I'd guess because whatever hash generates the ID strings doesn't take template parameters into account.
Comment 11 Dimitri van Heesch 2011-05-01 20:23:17 UTC
Confirmed. The problem is the combination of grouping and functions that only differ in the number of template arguments. Should be fixed in the next subversion update.

Jim: if you have a specific example that shows the problem in the XML output, then please attach it so I can see if it is also fixed.
Comment 12 Jim Bosch 2011-05-01 22:12:59 UTC
Created attachment 186997 [details]
source file for XML test case
Comment 13 Jim Bosch 2011-05-01 22:13:46 UTC
Created attachment 186998 [details]
configuration file for XML test case (with ambiguous.cc)
Comment 14 Jim Bosch 2011-05-01 22:14:51 UTC
XML example attached.  Bug is in the fact that the "id" attributes of the memberdef entries in classClass.xml are not distinct.

Thanks!
Comment 15 Dimitri van Heesch 2011-08-14 14:04:39 UTC
This bug was previously marked ASSIGNED, which means it should be fixed in
doxygen version 1.7.5. Please verify if this is indeed the case. Reopen the
bug if you think it is not fixed and please include any additional information
that you think can be relevant.