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 634600 - redefinition of typedef leads to declaration/definition missmatch
redefinition of typedef leads to declaration/definition missmatch
Status: RESOLVED FIXED
Product: doxygen
Classification: Other
Component: general
1.7.2-SVN
Other Linux
: Normal normal
: ---
Assigned To: Dimitri van Heesch
Dimitri van Heesch
Depends on:
Blocks:
 
 
Reported: 2010-11-11 16:33 UTC by marius.giurgi
Modified: 2011-01-03 19:01 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
typedef related declaration/definition mismatch test files (18.25 KB, application/x-bzip)
2010-11-11 16:33 UTC, marius.giurgi
Details

Description marius.giurgi 2010-11-11 16:33:38 UTC
Created attachment 174264 [details]
typedef related declaration/definition mismatch test files

This is a case of declaration/definition method mismatch when a typedef (public) defined in one class is used in another class via a redefinition of the type.

Here's the example (source/config files included) :


/**
 * classA
 *
 * This class has an internal (public) typedef defined
 */
class classA
{
 public:
  /**
   *  classA's internal typedef
   */
  typedef unsigned short MyType;

  /**
   *  @brief constructor
   */
  classA()
    {
    }

  /**
   *  @brief destructor
   */
  ~classA()
    {
    }
};

This code is part of the header file.
The second class (classB) uses the classA's typdef directly in the declaration:

/**
 * classB
 * 
 * This class is using classA's internal (public) typdef
 */
class classB
{
 public:

  /**
   *  @brief constructor
   */
  classB()
  {}

  /**
   *  @brief constructor
   */
  ~classB()
  {}

  /**
   * classB method using classA's internal (public) typedef directly
   */
  void myMethod(classA::MyType var);

};


Now, the source file's definition of myMethod uses the classA's type via a local redefinition:

typedef classA::MyType myTypeShortcut;


// method definition is using classA's typdef indirectly via the above redefinition
void classB :: myMethod(myTypeShortcut var)
{
  // do something here with my redefined type
}


The doxygen output (file included) warns that there is a mismatch between myMethod declaration/definition. The print out however lists the two as being identical:

Searching for member function documentation...
/home/marius/temp/doxygenTest/doxygenTypedefTest.cpp:8: warning: no matching class member found for 
  void classB::myMethod(classA::MyType var)
Possible candidates:
  void classB::myMethod(classA::MyType var)

Note: I use the latest SVN version and the doxygen.cfg is generated via doxygen -g doxygen.cfg (with no other changes to the configuration file)
Comment 1 Dimitri van Heesch 2010-11-12 22:28:46 UTC
Confirmed. Should be fixed in the next subversion update.
Comment 2 Dimitri van Heesch 2011-01-03 19:01:07 UTC
This bug was previously marked ASSIGNED, which means it should be fixed in
doxygen version 1.7.3. 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.