Skip to content

Extend IWYU checks to headers without a matching .cc file #4581

Description

@om7057

Context

While working on PR #4574, we found that sdk/include/opentelemetry/sdk/metrics/view/predicate_factory.h uses uint8_t without including <cstdint>. It compiled only because something else in the same translation unit happened to pull that header in transitively. This kind of bug is exactly what include-what-you-use (IWYU) checks are meant to catch, but it slipped through because this header has no matching .cc file of its own to anchor an IWYU check against.

Proposal

Look into extending the project's IWYU tooling/CI so that header-only files (headers with no corresponding .cc translation unit in the same directory) are also checked for missing or unnecessary includes, rather than relying on incidental coverage from whichever .cc file happens to include them first.

Related

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    help wantedGood for taking. Extra help will be provided by maintainerstriage/acceptedIndicates an issue or PR is ready to be actively worked on.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions