Skip to content

Commit d71adeb

Browse files
committed
[include-cleaner] Map the 4-argument move overload to the algorithm header.
Differential Revision: https://reviews.llvm.org/D159463
1 parent 87568ff commit d71adeb

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

clang-tools-extra/include-cleaner/lib/FindHeaders.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,10 @@ headerForAmbiguousStdSymbol(const NamedDecl *ND) {
125125
if (FD->getNumParams() == 1)
126126
// move(T&& t)
127127
return tooling::stdlib::Header::named("<utility>");
128-
if (FD->getNumParams() == 3)
128+
if (FD->getNumParams() == 3 || FD->getNumParams() == 4)
129129
// move(InputIt first, InputIt last, OutputIt dest);
130+
// move(ExecutionPolicy&& policy, ForwardIt1 first,
131+
// ForwardIt1 last, ForwardIt2 d_first);
130132
return tooling::stdlib::Header::named("<algorithm>");
131133
} else if (FName == "remove") {
132134
if (FD->getNumParams() == 1)

clang-tools-extra/include-cleaner/unittests/FindHeadersTest.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,16 @@ TEST_F(HeadersForSymbolTest, AmbiguousStdSymbols) {
546546
"move",
547547
"<algorithm>",
548548
},
549+
{
550+
R"cpp(
551+
namespace std {
552+
template<class ExecutionPolicy, class ForwardIt1, class ForwardIt2>
553+
ForwardIt2 move(ExecutionPolicy&& policy,
554+
ForwardIt1 first, ForwardIt1 last, ForwardIt2 d_first);
555+
})cpp",
556+
"move",
557+
"<algorithm>",
558+
},
549559
{
550560
R"cpp(
551561
namespace std {

0 commit comments

Comments
 (0)