[PATCH] D159463: [include-cleaner] Map the 4-argument move overload to the algorithm header.

Viktoriia Bakalova via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Sep 6 04:27:23 PDT 2023


VitaNuo created this revision.
Herald added a subscriber: kadircet.
Herald added a project: All.
VitaNuo requested review of this revision.
Herald added a project: clang-tools-extra.
Herald added a subscriber: cfe-commits.

Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D159463

Files:
  clang-tools-extra/include-cleaner/lib/FindHeaders.cpp
  clang-tools-extra/include-cleaner/unittests/FindHeadersTest.cpp


Index: clang-tools-extra/include-cleaner/unittests/FindHeadersTest.cpp
===================================================================
--- clang-tools-extra/include-cleaner/unittests/FindHeadersTest.cpp
+++ clang-tools-extra/include-cleaner/unittests/FindHeadersTest.cpp
@@ -546,6 +546,16 @@
           "move",
           "<algorithm>",
       },
+      {
+          R"cpp(
+            namespace std {
+             template<class ExecutionPolicy, class ForwardIt1, class ForwardIt2>
+             ForwardIt2 move(ExecutionPolicy&& policy,
+                 ForwardIt1 first, ForwardIt1 last, ForwardIt2 d_first);
+            })cpp",
+          "move",
+          "<algorithm>",
+      },
       {
           R"cpp(
             namespace std {
Index: clang-tools-extra/include-cleaner/lib/FindHeaders.cpp
===================================================================
--- clang-tools-extra/include-cleaner/lib/FindHeaders.cpp
+++ clang-tools-extra/include-cleaner/lib/FindHeaders.cpp
@@ -125,8 +125,10 @@
     if (FD->getNumParams() == 1)
       // move(T&& t)
       return tooling::stdlib::Header::named("<utility>");
-    if (FD->getNumParams() == 3)
+    if (FD->getNumParams() == 3 || FD->getNumParams() == 4)
       // move(InputIt first, InputIt last, OutputIt dest);
+      // move(ExecutionPolicy&& policy, ForwardIt1 first,
+      // ForwardIt1 last, ForwardIt2 d_first);
       return tooling::stdlib::Header::named("<algorithm>");
   } else if (FName == "remove") {
     if (FD->getNumParams() == 1)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D159463.556003.patch
Type: text/x-patch
Size: 1524 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20230906/aa615e3e/attachment.bin>


More information about the cfe-commits mailing list