| Issue |
202478
|
| Summary |
[clang-tidy] readability-non-const-parameter may redefine an overloaded function
|
| Labels |
clang-tidy
|
| Assignees |
|
| Reporter |
e-kwsm
|
```json
[{
"directory": "/tmp",
"command": "clang++ -c -o a.o a.cpp",
"file": "a.cpp",
"output": "a.o"
}]
```
```cpp
double f(double *x) { return *x; }
double f(const double *x) { return *x; }
```
```console
$ clang-tidy --checks='-*,readability-non-const-parameter' a.cpp
1 warning generated.
a.cpp:1:18: warning: pointer parameter 'x' can be pointer to const [readability-non-const-parameter]
1 | double f(double *x) { return *x; }
| ^
| const
```
This results in redefinition of `f`.
<https://godbolt.org/z/M96KhK91Y>
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs