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

    <tr>
        <th>Summary</th>
        <td>
            `misc-const-correctnes.WarnPointersAsValues` not reported for all variables in multi-declaration
        </td>
    </tr>

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

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

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

<pre>
    ```cpp
class A;

extern const A* cb();

void f()
{
    const A *a1 = cb(), *a2 = cb(); // no a2 warning

    const A * const a3 = cb(), *a4 = cb();
}
```

```
<source>:7:5: warning: variable 'a1' of type 'const A *' can be declared 'const' [misc-const-correctness]
    const A *a1 = cb(), *a2 = cb(); // no a2 warning
    ^
<source>:9:5: warning: variable 'a4' of type 'const A *' can be declared 'const' [misc-const-correctness]
    const A * const a3 = cb(), *a4 = cb();
    ^
```
https://godbolt.org/z/aK8o1Gfnh

I guess it's a known limitation but it doesn't appear to be documented,

CC'ing @JonasToth 
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJy9VMGO2jAQ_RrnMlqU2ASSQw4s7FZtLz1U7dmxJ-DW2JHtsN1-fScBdgGttFKlFsXGnhm9ee9NoPX6uWGL_Piovmf5huUrZWWMsGLi_ng_7vgrYXCgvIuJknwFqmW8Yry-KTx4o6E7pY7x5akA6HMCAEKQBTCxecXh6ynKr6PinqKP9IDzQMknGZxx28uWN7insxRvws9v4c8kN6fD2ZDLDrdBsY5-CAqZeGBitaRV0nrhRseDDEa2FqnnUha0ge8gPfdT4ILsmFHSQYugkawPqF8qxhwr7_cmqrspQHsIqJLDGFm5-VeujoisfHhTa_2e1vl_1PpXk75Wdz3YXUp9JElHb7Zet96mmQ9buv2mJT9XvvjQud3ly_ERtgORBDOKiCDhp_NPDqzZmyST8SR4SJQF7TE6qiHGfY8yQPKTF14Ne3QJNTG_BF6vqZg8BjbPP3kn41efdpBhUywWohYV5yLTjdC1qGWWTLI4_pzftHD2ncb1xRvqEuIqfpOWKFMxjT9BwN4Hag-dDyCtfRkoaXKwH2wyd8eBTXKyIdjmximTdkM7U35PF2sP56-7PvgfxICuJsaxJX8sl7UQ2a7BZa1U2amuwAq7TgrVlVpoXi90Sd10ZmWLNjb0VtD8M9PwnPO85qIQuZiLWSXbeSGLRaV4i1WHZBLupbGzsfE4syw0E4d22EZKWhNTfE3Sn5zZOsQzvhzSzoemMwGf5AGziW8zkf0DUeZ8nQ">