Skip to content

[clang] Support unnamed parameters in -Wdocumentation #172470

@carlosgalvezp

Description

@carlosgalvezp

Currently -Wdocumentation does not support unnamed parameters, since it requires that a name is present. For example:

/// @param some unnamed parameter
/// @param y something 
void f(int, int y) {}

It fails with:

<source>:1:12: warning: parameter 'some' not found in the function declaration [-Wdocumentation]
    1 | /// @param some unnamed parameter
      |            ^~~~

https://godbolt.org/z/efqxdTTjb

It would be great if this use case could be supported in some way. In a relevant Doxygen thread they propose using an integer to identify the unnamed parameter:

/// @param 1 some unnamed parameter

Metadata

Metadata

Assignees

No one assigned

    Labels

    clang:diagnosticsNew/improved warning or error message in Clang, but not in clang-tidy or static analyzerclang:frontendLanguage frontend issues, e.g. anything involving "Sema"enhancementImproving things as opposed to bug fixing, e.g. new or missing feature

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions