From 66bc184104a61fc5ea8ae06cd0cfb0de57ca1824 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20N=C3=BCcke?= Date: Sat, 5 Jul 2025 10:28:06 +0200 Subject: [PATCH 1/2] Add IWYU pragmas for provider header --- include/toml++/toml.hpp | 2 ++ 1 file changed, 2 insertions(+) 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 From e8841683cbd3c5fde49b1a5d87981bcc6d819de6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20N=C3=BCcke?= Date: Sat, 5 Jul 2025 10:55:50 +0200 Subject: [PATCH 2/2] Don't include IWYU pragmas in single-header toml.hpp --- tools/generate_single_header.py | 2 ++ 1 file changed, 2 insertions(+) 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'