New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

redefinition of typedef leads to declaration/definition missmatch (Origin: bugzilla #634600) #4010

Closed
doxygen opened this Issue Jul 2, 2018 · 0 comments

Comments

Projects
None yet
1 participant
@doxygen
Owner

doxygen commented Jul 2, 2018

status RESOLVED severity normal in component general for ---
Reported in version 1.7.2-SVN on platform Other
Assigned to: Dimitri van Heesch

Original attachment names and IDs:

On 2010-11-11 16:33:38 +0000, marius.giurgi@gmail.com wrote:

Created attachment 174264
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)

On 2010-11-12 22:28:46 +0000, Dimitri van Heesch wrote:

Confirmed. Should be fixed in the next subversion update.

On 2011-01-03 19:01:07 +0000, Dimitri van Heesch wrote:

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.

@doxygen doxygen closed this Jul 2, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment