From 82cb244b90c601103c1efe03ea40f30348913c7d Mon Sep 17 00:00:00 2001 From: Niels Lohmann Date: Tue, 13 Oct 2026 10:11:13 +0200 Subject: [PATCH] Mark json_fwd.hpp as exported by json.hpp for IWYU / include-cleaner json_fwd.hpp is the only header declaring the nlohmann::json alias, so include-what-you-use and clang-tidy's misc-include-cleaner attributed the name to it and told users of to include json_fwd.hpp as well (or instead, which breaks compilation). Fixes #5812 Signed-off-by: Niels Lohmann --- include/nlohmann/json.hpp | 2 +- single_include/nlohmann/json.hpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/nlohmann/json.hpp b/include/nlohmann/json.hpp index fae89829a..d2eb80353 100644 --- a/include/nlohmann/json.hpp +++ b/include/nlohmann/json.hpp @@ -74,7 +74,7 @@ #include #include #include -#include +#include // IWYU pragma: export #include // IWYU pragma: keep #include diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index b6b927835..c20b295f8 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -27776,7 +27776,7 @@ NLOHMANN_JSON_NAMESPACE_END // #include // #include - +// IWYU pragma: export // #include // __ _____ _____ _____ // __| | __| | | | JSON for Modern C++