<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/152697>152697</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[clang-tidy] readability-isolate-declaration: add option to suppress warning if types are the same
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang-tidy
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
chrchr-github
</td>
</tr>
</table>
<pre>
~~~c++
int main() {
int a{}, b{}, c{}; // ok, don't warn
int v(1), &x(v), *y(nullptr), z[2] = {}; // warn here
}
~~~
~~~
<source>:2:5: warning: multiple declarations in a single statement reduces readability [readability-isolate-declaration]
2 | int a{}, b{}, c{};
| ^~~~~~~~~~~~~~~~~~
<source>:3:5: warning: multiple declarations in a single statement reduces readability [readability-isolate-declaration]
3 | int v(1), &x(v), *y(nullptr), z[2] = {};
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~
https://godbolt.org/z/nbv6o1YjK
</pre>
<img width="1" height="1" alt="" src="http://email.email.llvm.org/o/eJzEVMFunDAQ_ZrhMtqVGa8XOHBgs-HSL-jRgANODUa22XZz4Nsr022ySiqlh0q1EMyMeWO_Nx5L73U_KVWCOIE4J3IJg3VlO7h2cLteh2FpksZ213Jd1xboFB9W6SngKPUElAMVCFkMIiLGCRnd7Az0gM2b2d5MfkKgGqhG-y3GOzsBZQG_SzfdJbkA5SlQEX8BOv4Ayi-vbnUFyqfFmDm4W_AFxIlAnBH4GT8sFZPjoJwCVsUZVq3r-voG_uDt4loF_BF4RcArAbzaUHrqozkuJujZKOxUa6STQdvJo55QotdTbxT6IIMa1RTQqW5plUenZCcbbXS4IojTnbvT3hoZ1O4uG4jzjT4hZA_4t2reQLiBQDyu78dHgvw_E-TbXv9dlT-V4M_jtf5DCLMHXv06LL3tGmvC3roeqH4BqqfmcrTp1-cvSVfyruCFTFSZZuJwFILxQzKUTdYeno4Nk0dJjKVcpV1BhWLd8SlvhaREl8RIsJzlKaWM0z47sFYcijSjQpHICQ5MjVKbvTGXMa6daO8XVaaCjkWWGNko47cuJWqNnPpd0N0VKKqRuDKids3Sezgwo33wb3mCDmbr7zuYOONn1eIVyq5DO0cPg0W_zLNT3v8-NaifMFxn5VE6hWFQ6OWoksWZ8p2g2y2yb-0IVMdt3T672dln1QageuPqgeob3UtJPwMAAP__Ofxtlw">