Skip to content

Child class with template parameter named differently than parent: unqualified base class in tagfile #10499

Closed
@cgrooves

Description

@cgrooves

Describe the bug
The setup is as follows:

  • A base class with a template parameter, inside of a namespace
  • A child class with a template parameter that passes it through to the base class template, only name the template parameter differently
  • Export the tagfile

Example:

namespace parent
{
/// \brief Some Parent class
template<typename T>
struct Parent
{
    T foo_ = 0; ///< the parent's foo
};
}

namespace child
{
/// \brief Some derived class
template<typename FooType>
struct Child
    : public parent::Parent<FooType>
{
    FooType bar_ = 0; ///< the child's bar
};
}

 
Expected behavior
In the tagfile, I would expect to see the namespace-qualified base class listed with its template parameter. Instead, the base class is not fully qualified.

Expected:

  <compound kind="struct">
    <name>child::Child</name>
    <filename>structchild_1_1Child.html</filename>
    <templarg>typename FooType</templarg>
    <base>parent::Parent</base>

Produced:

  <compound kind="struct">
    <name>child::Child</name>
    <filename>structchild_1_1Child.html</filename>
    <templarg>typename FooType</templarg>
    <base>Parent&lt; FooType &gt;</base>

This creates further complications if the Child and the Parent class are named the same, since any project that consumes this one's tagfile will produce an error about a possible recursive relationship between the parent and child class. Change the above example to where both the Child and Parent class are renamed to FooClass, and create another Doxygen project that uses this one's tagfile, and you will get the following error:

<unknown>:3: warning: Detected potential recursive class relation between class child::FooClass and base class FooClass< FooType >!

To Reproduce
See the README.md in the attached .zip. Will produce the FooProj.tags file with the unqualified base class, and show the "recursive class relation" when building the BarProj project documentation.

doxygenExample.zip

Version
Doxygen 1.9.6, RHEL8 and Windows 10.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions