<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/76722>76722</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
clangd: iwyu export and NOLINT do not supress warning if an include is after a function declaration in a C header
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
apache-hb
</td>
</tr>
</table>
<pre>
```h
// header1.h
#pragma once
#include <stdbool.h>
int cpp_input(void *extra, char *out, int size);
#include "header2.h" // IWYU pragma: export
```
```h
// header2.h
#pragma once
#define YY_INPUT(buffer, result, size) result = flex_input(yyextra, buffer, size);
extern int i;
```
produces `Included header header2.h is not used directly (fix available)`. moving the include before the first declaration fixes this.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyMk09vozAQxT-NuYyKnCEl5MChTTdSpFV3D61WPVXGHsArx0b-kyb76VcQmlTtHlZCRrzxwPs9DyIE3Vmimt3es9uHTKTYO1-LQciebvoma5w61azk56tn_IHxO4ZbhlvoSSjyi_yiFoMX3V6As5Jm7b2irTRJEbBiE6JqnDN5z4pvH3dpG0EOw6u2Q4oMq4PTChje0TF6wXADshd-FNxY3sC4P-g_xHDNivuvX0I8G8S8Z4gwm979enmGs09W3AEdB-fj3PyO-enxX9T4X9SKWm0JXl5ed48_n58YVk1qW_KjfU8hmQlkhpgVYMUDtIaOlyBOp0sE1_Yv5NNKx0jeTtHoa-kT17QO3qkkKQAr-e4cmZrZroigA1gXIQVSoLQnGc0JGFatPoI4CG1EYyYbJc9h7w7adhB7gvdDaKh1niap1T5EUCSN8CJqZ6HVRwoQex3yTNWFWhdrkVG9WPEl8rKqVllfq1JhI7FpVFFVVcVVeavKasFbpHZN6zLTNXJc8gXHxXJZ8TLnC1EtGs5XS9lUa1mxJae90CY35rDPne8yHUKielWuEDMjGjJhGn9ES28wFRni-Df4euy5aVIX2JIbHWK4viXqaKiWRthOjZOk305pHicQVsHjj--7xydQbkowpMFTCPAmvB1D0i0Ie4lJBxBtJA8C2mTllM7HpLQFAZv5XLLkTd3HOARWzEPZ6dinJpduz3A7OpxvN4N3v0lGhtuJKzDcTtx_AwAA__-L_Tnk">