| Issue |
71529
|
| Summary |
clangd incorrecly says 'header is unused'
|
| Labels |
new issue
|
| Assignees |
|
| Reporter |
kelbon
|
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

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
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs