<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/58958>58958</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            Error message about pointer conversion instructs me to write a bug
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          notnullnotvoid
      </td>
    </tr>
</table>

<pre>
    ![image](https://user-images.githubusercontent.com/37276056/201498472-b6d7e4cc-93d4-4f7a-863d-f2d30e4c68ae.png)

When passing a variable of type `const char *` to a function accepting `void *`, I get an error message like the following:
```
bob.cpp:184:25: error: no matching function for call to 'MeowHash'
    meow_u128 hash128 = MeowHash(MeowDefaultSeed, strlen(path), path);
                        ^~~~~~~~
./meow_hash_x64_aesni.h:259:1: note: candidate function not viable: no known conversion from 'const char *' to 'void *' for 3rd argument; take the address of the argument with &
```
Presumably because of const-ness. This error message is correct, except for this instruction at the end: `take the address of the argument with &`. In this case the correct thing to is to explicitly cast to `void *`, and if I assumed the compiler knew what it was talking about and followed its instructions, I would write a potentially easy-to-miss pointer bug.

You could argue a programmer should have the dilligence to double-check and not trust the compiler in a case like this, and in principle I agree, but the type of inexperienced programmer who is most likely to find these hints helpful, and most likely to follow them, is also the type most likely to miss a bug like this, so I think this is likely to do harm in practice.

As far as I know there's no way for the compiler to tell what the correct solution in this case is, so the message should probably either not be printed in a case like this with incompatible pointer types, or rephrased to make it clear this is only a suggestion of what *might* be the solution.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyNVk1v6zYQ_DXyhbBgS9aHDz7kNS9oDgUKtEDRU0CRK4kNJQokZSf_vkNKTuw0hwqCJJPc3dmZXdKNke-nJNsnxQ818I6S4jHJ6t77ySX5Q5I94Z4d2W2cdWmnfD83YUSY0dPoU2EGrMmrrCp3RYnPbLc_HOtDlW2bUlZ0EGJ7zOVhe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