[clang-include-cleaner] "// IWYU pragma: export" on non-#include line ends enclosing "// IWYU pragma: begin_exports" block
- Dominant language
- LLVM
- Stars
- 40.5k
- Forks
- 18.7k
- PR merge metrics
- PR metrics pending
Description
include-what-you-use allows the `// IWYU pragma: export` comment to be applied to forward declarations. When the include cleaner comes across such a construct, any `begin_exports` block from an enclosing header file gets closed. I'm not sure if applying exports to forward declarations is supported by the include cleaner, but regardless, it'd be nice if it didn't have this side effect.
A.hpp
```c++
#pragma once
class foo; // IWYU pragma: export
```
B.hpp
```c++
#pragma once
```
C.hpp
```c++
#pragma once
// IWYU pragma: begin_exports
#include "A.hpp"
#include "B.hpp" // "Included header B.hpp is not used directly"
// IWYU pragma: end_exports
```
clangd version 22.1.0-rc1
Contributor guide
Assessment
This issue has not been assessed yet.