Skip to content

Unable to document default argument on friend functions #10846

@scott-zhong

Description

@scott-zhong

Describe the bug
Unable to document default argument on friend functions

/**
 * A docs
 */
class A
{
public:
    friend void fun(int i);
};

/**
 * fun docs
 */
void fun(int i = 0);

Does not show the default argument int i =0. The standard prohibits default argument in friend function declaration.

§8.3.6 If a friend declaration specifies a default argument expression, that declaration shall be a definition and shall be the only declaration of the function or function template in the translation unit.

It looks like Doxygen uses the friend declaration of the function instead of the definition.

Screenshots
1.8.9.1 - trunk (85eb55d)
image

The default argument int i = 0 is not documented.

To Reproduce
testcase.zip

Expected behavior
The default argument int i = 0 is documented.

Metadata

Metadata

Assignees

No one assigned

    Labels

    C/C++enhancementa request to enhance doxygen, not a bug

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions