Consider this code frequently found when interacting with C API:
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).