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 

![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

_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to