<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/71529>71529</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
clangd incorrecly says 'header is unused'
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
kelbon
</td>
</tr>
</table>
<pre>
Recently updated to llvm17 ~~(to get import std, but it is not yet available as i understand)~~ and If header used only in macro, then
![image](https://github.com/llvm/llvm-project/assets/58717435/71fabff7-7821-4ebf-b19e-24ccb48112dd)
While i use it:
```cpp
#define $lock(... /* mtx or sequence of mtxs */) \
::std::scoped_lock UNIQUE_NAME { \
__VA_ARGS__ \
}
struct my_mtx_t {};
void foo(...) {
$lock(mtx, other.mtx);
}
```
Its pretty common, for example in llvm itself:
// file abc.def
```cpp
A(a)
A(b)
A(c)
```
And in file bcd.hpp
```cpp
#define A(name) use_header(name)
#include "abc.def"
```
P.S. when import std will be available?) I saw commit implementing it dated 9 Sep, but llvm17 do not contain it yet
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyUVNGOozYU_RrzcjUoNgHCAw_JZlPNQ1ftjrZ9RMa-JO4am-LLzORlvr0yZMiO1KraKCIYk-Nzz7nnyhDM2SHWLD-w_JjIiS5-rL-jbb1LWq-v9VdU6MheYRq0JNRAHqx97nkJb29M7MjDGQlMP_iRIJBm4hO0E4EhMAGcJ7gigXyWxsrWIsgABiancQwknWaiensD6TQ8dnBBqXGEKaAG7-wVjINeqtFHULqgA7Y5ss3-dhWc5QfTyzOy_MjE7kI0BJbtmTgxcTobukxtqnzPxClSvv08DKP_CxUxcZIhIAUmTvmu5OU2y5k4lbyTbdeVD-VO8Icttt1Dyyt8EFul2u2Oc6Ej6R-J_HkxFmNVAcFQJLBsFpvlq4bhnXGmsTMOgYmt9eo7E7s0TWEmvIeeXsGPEPDvCZ1C8F18FICJpaQKWP5pQQKIx2T7KPhyo_yAuomg8O3L4-_fPjdf9r9-BlYeYP388HeApvlj3-y__vLUNB9wy-NyG2icFEF_bXp6bSgixb3ssGw_e6Oh834pYSZXHlaQtbyeXqN5ni44pvOiWiHWo1alluUjBRhGJLqC8n3vXUTo_Aj4KvshSu3mHgRDAW13F_wmcnQfuuiJbFWqsfsvP_ZM7ORqZly1H1bqbvRHhnunI4n5jFbp9LI6_L_OR1wne4yKTQGbpefvD9f3jVN20rFVxHsZQvwrm-X6W_qUwksMyT2M8GKshRbv-WPZ3EiPEOTLrK6Zw2uxR0fGnWNul6BX8ITDe5pvkdd-TrTyjqRx8d0r0nJ8outMV1klE6x5UVVZXmW7LLnUKuNYFLrrhM6l3PBW8qpoM6Wziu8QeWJqsREZ55uSC16ILN0UUrVFmRW8U6JAzbYb7KWxaWSR-vGcmBAmrEueiyqxskUb5hEmhMMXmDejVvkxGes58u10Dmy7sSZQuKOQIYu1stKdo53KjyMqe4UgrzF05W0cmQCTizOJiTKZRlv_9JyZGYV5uOSi-icAAP__rdSclQ">