Skip to content

Commit 89ff142

Browse files
hzellerjbeder
authored andcommitted
Add IWYU export pragmas.
If a project is using the facade-header yaml-cpp/yaml.h it might get `misc-include-cleaner` warnings from the `clangd` language server and `clang-tidy` that this header is not providing directly the symbols used. The annotation with IWYU pragmas fixes that and tells the tools that it should consider all the includes as if they directly provided the symbol Documentation clangd and clang-tidy https://clang.llvm.org/extra/clang-tidy/checks/misc/include-cleaner.html points to https://clangd.llvm.org/design/include-cleaner#iwyu-pragmas This has been first implemented and docuemnted in the include-what-you-use project https://github.com/include-what-you-use/include-what-you-use/blob/master/docs/IWYUPragmas.md#iwyu-pragma-begin_exportsend_exports Signed-off-by: Henner Zeller <[email protected]>
1 parent 3738976 commit 89ff142

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

include/yaml-cpp/yaml.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@
77
#pragma once
88
#endif
99

10+
// IWYU pragma: begin_exports
11+
1012
#include "yaml-cpp/parser.h"
1113
#include "yaml-cpp/emitter.h"
1214
#include "yaml-cpp/emitterstyle.h"
@@ -21,4 +23,6 @@
2123
#include "yaml-cpp/node/parse.h"
2224
#include "yaml-cpp/node/emit.h"
2325

26+
// IWYU pragma: end_exports
27+
2428
#endif // YAML_H_62B23520_7C8E_11DE_8A39_0800200C9A66

0 commit comments

Comments
 (0)