-
Notifications
You must be signed in to change notification settings - Fork 15.5k
Closed
Labels
clang-include-cleanerclang:toolingLibToolingLibToolinggood first issuehttps://github.com/llvm/llvm-project/contributehttps://github.com/llvm/llvm-project/contributehelp wantedIndicates that a maintainer wants help. Not [good first issue].Indicates that a maintainer wants help. Not [good first issue].
Description
For the following example
#include <algorithm>
struct Foo {
int value;
double bar() const { return value * 2; }
};
int main() {
std::vector<Foo> v;
const double to_find = 10;
std::ranges::upper_bound(v, to_find, std::less{}, &Foo::bar);
return 0;
}misc-include-cleaner emits errors
*/sandbox.cpp:57:16: error: no header providing "std::ranges::binary_search" is directly included [misc-include-cleaner,-warnings-as-errors]
33 | std::ranges::binary_search(v, to_find, std::less{}, &Foo::bar);
as well as
sandbox.cpp:35:1: error: included header algorithm is not used directly [misc-include-cleaner,-warnings-as-errors]
The suggested fix is #include <bits/ranges_algo.h> that seems incorrect.
The same function std::ranges::sort from this header (<bits/ranges_algo.h>) is handled perfectly.
Bouncner and igorqs
Metadata
Metadata
Assignees
Labels
clang-include-cleanerclang:toolingLibToolingLibToolinggood first issuehttps://github.com/llvm/llvm-project/contributehttps://github.com/llvm/llvm-project/contributehelp wantedIndicates that a maintainer wants help. Not [good first issue].Indicates that a maintainer wants help. Not [good first issue].