Doxygen malfunction due to forward declaration

Viewed 41

the Doxygen output is bugy due to the forward declaration in the header "fileA.h"

It starts with the doxygen Class List where for Class A the header-description does not appear

Class List: fileA description not visible

And than the copyright and author strings of fileA are displayed in the member function Documentation.

enter image description here

When i include the header-file with the #include directive instead of the forward declaration everything is correct. But in the final project i need to use forward declaration due to ring-includes.

For Class B without forward declaration everything looks like expected

enter image description here

I use doxygen 1.9.5

Here is the sourcecode for this little example:

Sources for fileA.h

/*******************************************************************************
 * @copyright        Copyright (c) 2021
 *******************************************************************************
 * @author  Mr. Embedded
 *
 * @brief This description and the copyright and author info
 * shall be displayed in the doxygen "class Referece" in the section "Detailed Description"
 * for all classes that are declared in this header-file.
 *
 ******************************************************************************/
#ifndef _FILE_A_H
#define _FILE_A_H

// forward declaration
class B;

class A{
public:
   B *b;
   void test(void);
};

#endif

Sources for fileA.cpp

/*******************************************************************************
 * @copyright        Copyright (c) 2021
 *******************************************************************************
 * @author  Mr. Embedded
 *
 ******************************************************************************/

#include "fileA.h"
#include "fileB.h"

/*******************************************************************************
 * @brief test Dummy
 ******************************************************************************/
void A::test()
{
   b = new B;
   b->test();
}

Sources for fileB.h

/*******************************************************************************
 * @copyright        Copyright (c) 2021
 *******************************************************************************
 * @author  Mr. Embedded
 *
 * @brief This description and the copyright and author info
 * shall be displayed in the doxygen "class Referece" in the section "Detailed Description"
 * for all classes that are declared in this header-file.
 *
 ******************************************************************************/
#ifndef _FILE_B_H
#define _FILE_B_H

class B{
public:
   void test(void);
};

#endif

Sources for fileB.cpp

/*******************************************************************************
 * @copyright        Copyright (c) 2021
 *******************************************************************************
 * @author  Mr. Embedded
 *
 ******************************************************************************/

#include "fileB.h"

/*******************************************************************************
 * @brief test Dummy
 ******************************************************************************/
void B::test()
{
}

and the doxyfile differece with the default doxyfile

$ doxygen -x doxyfile
# Difference with default Doxyfile 1.9.5 (87846a24ba5d96a548e5e1a377c2ff078a77dd77)
SHORT_NAMES            = YES
JAVADOC_AUTOBRIEF      = YES
JAVADOC_BANNER         = YES
MULTILINE_CPP_IS_BRIEF = YES
EXTENSION_MAPPING      = h=C++
EXTRACT_ALL            = YES
EXTRACT_PRIVATE        = YES
EXTRACT_STATIC         = YES
EXTRACT_LOCAL_METHODS  = YES
EXTRACT_ANON_NSPACES   = YES
SHOW_NAMESPACES        = NO
INPUT                  = fileA.h \
                         fileA.cpp \
                         fileB.h \
                         fileB.cpp
RECURSIVE              = YES
SOURCE_BROWSER         = YES
DIR_GRAPH_MAX_DEPTH    = 10
0 Answers
Related