GNOME Bugzilla – Bug 153366
Fails to recognize class template members with changed parameter names
Last modified: 2018-07-30 10:02:21 UTC
[forwarded from http://bugs.debian.org/235576] Doxygen seems lost when you changed the name of a parameter in class templates. Consider the following piece of code, where the declaration of foo and its implementation differ on the name of parameter: Key, or K: /** ** \file misc/set.hh **/ /// Wrapper around std::set. template < typename Key > class set { /// Union with another set \a s. void foo (const set& s) const; }; // class set // Union with another set \a s. template < class K > void set<K>::foo (const set<K>& s) const { } Doxygen reports: Searching for member function documentation... /tmp/misc/set/set.hh:17: Warning: no matching class member found for template < K > void set< K >::foo(const set< K > &s) const Possible candidates: void set< Key >::foo(const set &s) const If you use the same parameter name it works in both case. Also, it seems that the problem is not in recognizing that both are related to the class set<K>, it seems to be related to the argument of `foo'. Indeed, if `foo' takes void, or int, as argument, the problem is solved, independently of the name of the template parameter. Worse yet: Doxygen accepts happily the following incorrect C++ code, where I have used `set' without template parameters inside the implementation of `foo': -------------------------------------------------- /** ** \file misc/set.hh **/ /// Wrapper around std::set. template < typename Key > class set { /// Union with another set \a s. void foo (const set& s) const; }; // class set // Union with another set \a s. template < class K > void set<K>::foo (const set& s) const { } -------------------------------------------------- Searching for enumerations... Searching for member function documentation... Searching for members imported via using declarations... Building page list...
I confirm the same problem with doxygen 1.4.7. template <class T_ITEM> class AbstractList : public lang::Object { public : typedef T_ITEM* Iterator; void remove(Iterator it); }; template <class T_ITEM> void util::AbstractList<T_ITEM>::remove (typename util::AbstractList<T_ITEM>::Iterator it) { //... } result in AbstractList.h:224: Warning: no matching class member found for template < T_ITEM > void remove(util::AbstractList< T_ITEM >::T_ITEM *it) Possible candidates: void util::AbstractList< T_ITEM >::remove(Iterator it)
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!