Skip to content

\copydoc for file dox does not copy brief #10220

Closed
@cgrooves

Description

@cgrooves

Describe the bug
Trying to use \copydoc in a file Doxymentation block does not copy over the brief of the target to the file's \brief section.

Expected behavior
Expected that the target's brief referenced in the \copydoc command would be inserted for the file's \brief section. Quoting from https://www.doxygen.nl/manual/commands.html#cmdcopybrief (as of 8/8/2023):

Note that \copydoc foo() is roughly equivalent to doing:

\brief \copybrief foo()
\details \copydetails foo()

To Reproduce

mainpage.dox:

/**

\mainpage Main Page

Take a look at \ref faulty.h for the unexpected behavior with Doxygen 1.9.6.

Take a look at \ref expected.h for the expected behavior.

*/

faulty.h:

#ifndef FAULTY_H
#define FAULTY_H

/**
 * \file
 * \copydoc foobar
*/

/**
 * \brief Some function that adds 2.
 * \details More details on this function here.
*/
unsigned int foobar(unsigned int x)
{
    return x + 2;
}

#endif

expected.h:

#ifndef EXPECTED_H
#define EXPECTED_H

/**
 * \file
 * \brief \copybrief expectedTarget
 * \details \copydetails expectedTarget
*/

/**
 * \brief Some function that adds 2.
 * \details More details on this function here.
*/
unsigned int expectedTarget(unsigned int x)
{
    return x + 2;
}

#endif

Add these three files as inputs to a Doxyfile, and generate and inspect the HTML.

Doxyfile INPUT section:

INPUT                  = mainpage.dox \
                         faulty.h \
                         expected.h

Screenshots

Here is the generated faulty.h documentation:

image

Here is the generated expected.h documentation:

image

Version
Doxygen 1.9.6 tag, running on RHEL8, compiled from source.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions