diff --git a/include/toml++/toml.hpp b/include/toml++/toml.hpp index 61790c74..0717cc45 100644 --- a/include/toml++/toml.hpp +++ b/include/toml++/toml.hpp @@ -31,6 +31,7 @@ TOML_PRAGMA_CLANG(diagnostic ignored "-Wreserved-identifier") #endif #endif +// IWYU pragma: begin_exports #include "impl/std_new.hpp" #include "impl/std_string.hpp" #include "impl/std_optional.hpp" @@ -56,6 +57,7 @@ TOML_PRAGMA_CLANG(diagnostic ignored "-Wreserved-identifier") #include "impl/toml_formatter.hpp" #include "impl/json_formatter.hpp" #include "impl/yaml_formatter.hpp" +// IWYU pragma: end_exports #if TOML_IMPLEMENTATION diff --git a/tools/generate_single_header.py b/tools/generate_single_header.py index f2874896..fed4ae4e 100755 --- a/tools/generate_single_header.py +++ b/tools/generate_single_header.py @@ -122,6 +122,8 @@ def main(): toml_h = re.sub(r'([^@][({,])\n\n', r'\1\n', toml_h) # blank lines preceeding closing brackets toml_h = re.sub(r'\n\n([ \t]*[})])', r'\n\1', toml_h) + # IWYU pragmas + toml_h = re.sub(r'\n// IWYU pragma: [^\n]+\n', '\n', toml_h) # ensure only one trailing newline toml_h = toml_h.strip() + '\n'