Search code examples
c++doxygen

Doxygen report "potential recursive class relation"


I have a C++ templated class base::Foo<class T>, and I have in another file a class base::bar::Foo : public base::Foo<Baz>. Doxygen seems not to like this, as it throws an error

<unknown>:1: Detected potential recursive class relation between class snLib::mocTwod::DsaCell and base class DsaCell< snLib::mocTwod::ProblemTraits, detLib::cellDiffusionTwod::ProblemTraits >!

Is there a way to prevent this from occurring? Doxygen's documentation doesn't talk about this error or anything about "potential recursive class relation"s.

The "base" class:

/*! \file snlib/DsaCell.hpp
 */
#ifndef snlib_DsaCell_hpp
#define snlib_DsaCell_hpp
#include "Dsa.hpp"

namespace snLib {
/*!
 * \brief  Implementation of naive cell-centered DSA
 */
template <class HoTraits_T, class LoTraits_T>
class DsaCell : public snLib::Dsa< HoTraits_T, LoTraits_T >
{
    [snip]
};
}
#endif

one of its descendants that is causing the problem:

/*! \file snlib/twod/moc/DsaCell.hpp
 */
#ifndef snlib_twod_moc_DsaCell_hpp
#define snlib_twod_moc_DsaCell_hpp
#include "snlib/DsaCell.hpp"

#include "ProblemTraits.hpp"
#include "detlib/twod/celldiffusion/ProblemTraits.hpp"

namespace snLib { namespace mocTwod {
/*!
 * \brief Inconsistent DSA for MOC
 */
class DsaCell : public snLib::DsaCell<
                        snLib::mocTwod::ProblemTraits,
                        detLib::cellDiffusionTwod::ProblemTraits
                        >
{
    [snip]
};
} } // end namespace snLib::mocTwod
#endif

My Doxygen configuration file has many options set, including the path configuration: STRIP_FROM_PATH (set to the root directory), STRIP_FROM_INC_PATH (same), INCLUDE_PATH (same).

Edit: it looks like the error was actually thrown in another Doxyfile that used the XML tags generated by the one with the conflicting name, so the problem was related to that. Anyway, I just renamed the base class to something else and all was well again.


Solution

  • This warning appears to have been fixed in doxygen 1.10.0. My project have this annoying warning until today when we upgraded from 1.9.7.