[clang] Support unnamed parameters in -Wdocumentation
Nobody has claimed this yet.
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
Currently `-Wdocumentation` does not support unnamed parameters, since it requires that a name is present. For example:
```cpp
/// @param some unnamed parameter
/// @param y something
void f(int, int y) {}
```
It fails with:
```cpp
: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](https://github.com/doxygen/doxygen/issues/6926) they propose using an integer to identify the unnamed parameter:
```cpp
/// @param 1 some unnamed parameter
```
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the reported C++ example with Clang's -Wdocumentation and locate the implementation of that warning. Review how documented parameter names are matched, then determine how the proposed integer syntax should identify unnamed parameters. Done means the documented unnamed parameter is accepted without a false warning while invalid parameter references still produce diagnostics.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- cpp
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100