Skip to content

Add IWYU pragmas for provider header #277

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jul 5, 2025

Conversation

fnuecke
Copy link
Contributor

@fnuecke fnuecke commented Jul 5, 2025

What does this change do?

This PR suggests adding IWYU pragmas to the main provider header, toml++/toml.hpp. This allows the header to be used as intended without warnings in projects with strict clangd include diagnostics configuration.

This is relevant for cases where the single-header toml.hpp is not used, e.g. when using the library via vcpkg (where the single-header isn't even available).

I've also added stripping of these macros/comments in the script generating the single-header, since they would be incorrect in there.

Is it related to an exisiting bug report or feature request?

No.

Pre-merge checklist

  • I've read CONTRIBUTING.md
  • I've rebased my changes against the current HEAD of origin/master (if necessary)
  • I've added new test cases to verify my change
  • I've regenerated toml.hpp (how-to)
  • I've updated any affected documentation
  • I've rebuilt and run the tests with at least one of:
    • Clang 8 or higher
    • GCC 8 or higher
    • MSVC 19.20 (Visual Studio 2019) or higher
  • I've added my name to the list of contributors in README.md

@fnuecke fnuecke force-pushed the feature/include-what-you-use branch from 81e7c8c to e884168 Compare July 5, 2025 09:05
@marzer
Copy link
Owner

marzer commented Jul 5, 2025

Great, thanks! TIL that IWYU has pragmas.

@marzer marzer merged commit bf869b0 into marzer:master Jul 5, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants