Issue |
131599
|
Summary |
[clang-tidy] False positive misc-const-correctness with double pointers
|
Labels |
clang-tidy,
false-positive
|
Assignees |
|
Reporter |
carlosgalvezp
|
Consider this code frequently found when interacting with C API:
```cpp
void foo(void**);
void bar()
{
void* ptr{};
foo(&ptr);
}
```
Here, clang-tidy wants `ptr` to be `void const* ptr` , i.e. pointing to `const void`. This change makes the program no longer compile.
https://godbolt.org/z/GrPYf7Gao
The warning goes away if I remove the braces initializing `ptr`. But as a user I should be able to do that anyway (some other guidelines require this).
_______________________________________________
llvm-bugs mailing list
llvm-bugs@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs