<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/77891>77891</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
clang-tidy check modernize-use-auto fails on pointer to array types
</td>
</tr>
<tr>
<th>Labels</th>
<td>
clang-tidy
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
ThomasHuetsch
</td>
</tr>
</table>
<pre>
The clang-tidy (LLVM 17.0.6, Windows) check modernize-use-auto fails when a pointer-to-array variable is assigned a value returned by new.
The code in the functions
```
void foo()
{
int(*pBar)[2] = new int[10][2];
}
```
is changed to
```
void foo()
{
auto = new int[10][2];
}
```
which is missing the variable name.
It should have been changed to this:
```
void foo()
{
auto pBar = new int[10][2];
}
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJykk0-L2zAQxT-NfBlsZNmKnYMPm4bQwva2tGdZGltqZSnoT0L66Yu92e4eCoUUjP_NaOa9HzwRo5kd4kD4gfBjIXLSPgwv2i8ifs6YotTF6NVteNEI0go3l8moGxDWPz9_-wp1V9FqR9gn-G6c8tdI2B6kRvkTFq8wOPMLyxyxFDl5mISxEa4aHQg4e-MShjL5UoQgbnARwYjRIpgId2EKBFyEzQgBUw7rj_EGDq8VoUdCn17vmzavEIyDpBGm7GQy3sV7047er-3z4o2CyXvCesL295bu8PoCAGBc2mpP54MIaws_MMKPQJrjunqr80NNCT_eS6Q5vM05_nWniSC1cDMqSP4BVRu9_9h_1UbqletiYjRu3jD94e3EghV8JPolQdQ-WwVaXBBGRPfBACRtImmeHjWycn3MTaGGRu2bvShwqDvKadv1PS_0wDvJd3KSvKkpMsEbpThve6x7KkYp68IMjLKW1jWjPWtbXqlpN1Eq20nuRD1STlqKizC2svayVD7MhYkx49B1_b4urBjRxi0mjL3ngLBVcBGG9VA55jmSlloTU3wfk0yyOHzIzj_i4d1bNFbUr9FItzPGIgc76JTOG3t2Iuw0m6TzWEm_EHZaN94f5Tn4HygTYafNRSTstBn5HQAA__-8MypA">