| Issue |
233284
|
| Summary |
[clang-tidy] misc-const-correctness to enforce const on by-value function parameters
|
| Labels |
clang-tidy
|
| Assignees |
|
| Reporter |
carlosgalvezp
|
It would be good if `misc-const-correctness` were extended to enforce const-correctness on by-value function parameters:
```cpp
void f(int x)
{
std::cout << x << std::endl;
}
```
Since `x` is not modified, the function should become:
```cpp
void f(int const x)
{
std::cout << x << std::endl;
}
```
This may be considered too pedantic so it could be under an off-by-default option, similar to `WarnPointersAsValues`.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs