<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/64587>64587</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
`misc-include-header` false positive for `localtime_r`
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
firewave
</td>
</tr>
</table>
<pre>
```cpp
#include <ctime>
void getLocaltime(struct tm <ime)
{
time_t t;
time(&t);
localtime_r(&t, <ime);
}
```
```
<source>:7:5: warning: no header providing "localtime_r" is directly included [misc-include-cleaner]
2 |
3 | void getLocaltime(struct tm <ime)
4 | {
5 | time_t t;
6 | time(&t);
7 | localtime_r(&t, <ime);
| ^
1 warning generated.
```
https://godbolt.org/z/Txehvrs8M
https://en.cppreference.com/w/c/chrono/localtime
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUU82u2ywQfZrxBiXCg38XXuQmn1dfd91fYTyxqYixACe9ffrKjpObRLdSK_kH5nCAc2ZGeq-7gaiC9A3SQySn0FtXHbWjizxT1Nj2o4KMXx81jsAPwHeAQg_KTC0xEHsV9IlA_Ldiy_dsdcs6Cv9bJc2CY-GDm1Rg4cQAszVYrqT87TpgjLEZeQ8sgHgJAhaAWZhZd8jcDnh3d3j_dMBtKeSHdXDT83jh16DYezs5tegSuxzELgWxYxfpBj1083CwrCfZkmOjs2fd6qFjgPh0IWTas1Y7UsF8sNWzlkH6dtJebdbARhmSAzlID5-CkUG-Z59zscz_0deZmFw3enQ4XUJ_9Dp7gr9yPb-v-Hv_l-V3HqRrvcQ3T1lHAzkZqN1-mZI-hNGD2AHWgHVn28aasLWuA6x_Adbff1J_dr749pjWZxINWzWOjo7kaFC0VfYEWF8AazW_vbODBazvmqK2Em0pShlRFWdlnGUoeB71VZ7GsVJlmXIhYsobkmVO2KaUJ2UhEx7pCjkKXsQ85nGc5FtRoKJECuIZKtVISDidpDZbY86nWUWkvZ-oypK0yCMjGzJ-6UrEgS5sAQFxblJXzZxNM3UeEm60D_5zl6CDobllnwrsWqiQcXaUxhMbrddBn4kdrWOQ8ccsZjyanKle7Nahn5rVsPmw9bcZnf1BKgDWyxU9YL1I-B0AAP__ITtB2g">