Skip to content

[clang-tidy] misc-include-cleaner false positives #93335

Closed
@carlosgalvezp

Description

@carlosgalvezp

Take the following example code that implements the log2 function with a custom implementation:

constexpr int log2()
{
    int output = 0;
    return output;
}

clang-tidy trunk gives:

[<[source>:1:15: warning: no header providing "log2" is directly included [misc-include-cleaner]]
    1 | constexpr int log2()
      |               ^
[<source>:3:9: warning: no header providing "output" is directly included [misc-include-cleaner]]
    3 |     int output = 0;
      |         ^
2 warnings generated.

Which seems incorrect. Repro: https://godbolt.org/z/roM8E34ce

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions