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 758900 - C++ templated member-function appears both as public and private
C++ templated member-function appears both as public and private
Status: RESOLVED FIXED
Product: doxygen
Classification: Other
Component: general
1.8.9.1
Other Linux
: Normal normal
: ---
Assigned To: Dimitri van Heesch
Dimitri van Heesch
Depends on:
Blocks:
 
 
Reported: 2015-12-01 13:43 UTC by ajneu1
Modified: 2015-12-30 10:19 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description ajneu1 2015-12-01 13:43:51 UTC
When generating documentation for the example at the bottom
using:
EXTRACT_PRIVATE        = YES

...the member-fuction 
   get
is listed under both private and public, 
even though it is *only private* !!!


http://melpon.org/wandbox/permlink/qlHpqKvfo9w4sYnn


// example
#include <iostream>
#include <initializer_list>
#include <map>

class MyClass {
private:
   std::map<int, double> mymap;

   template<typename T>
   std::map<int, double>::mapped_type get(int i);

   /*
   template<typename T>
   decltype(mymap)::mapped_type get(decltype(mymap)::key_type i);       // same declaration prototype (as above), but using decltype
   */
   
public:
   MyClass(std::initializer_list<decltype(mymap)::value_type> lst)
      : mymap(lst)
   {}

   double getwrapper(int i) {
      return get<int>(i);
   }
};


template<typename T>
std::map<int, double>::mapped_type MyClass::get(int i)
{
   T unused{}; // unused
   return mymap.at(i);
}


int main()
{
   MyClass my({{0, 0.0}, {1, 1.1}, {2, 2.2}, {3, 3.3}});

   std::cout << my.getwrapper(2) << std::endl;
   return 0;
}
Comment 1 ajneu1 2015-12-01 13:47:01 UTC
Perhaps similar to 
https://bugzilla.gnome.org/show_bug.cgi?id=611462
(but while that is shown as resolved, the code-example above really does still cause incorrect documentation)
Comment 2 Dimitri van Heesch 2015-12-06 10:37:32 UTC
Confirmed. Should be fixed in the next GIT update.
Comment 3 Dimitri van Heesch 2015-12-30 10:19:56 UTC
This bug was previously marked ASSIGNED, which means it should be fixed in
doxygen version 1.8.11. 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 (preferably in the form of a self-contained example).