summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbungeman <bungeman@chromium.org>2018-03-08 14:10:42 -0500
committerKim Grasman <kim.grasman@gmail.com>2018-03-09 20:04:20 +0100
commit314fc2d182a99386d073ebc44f7924a7d99cba43 (patch)
tree994de90619a7978a76b7eb752eb19061d1d96606
parent5de96e9005acf91bb78d82c26db687bdc37acbaa (diff)
<bits/move.h> is a part of <utility>.
<bits/move.h> provides std::forward, std::move, and std::swap. These are defined to come from <utility> and not <algorithm>. In c++11 and later std::swap comes from <utility>, previously it came from <algorithm>. Fortunately, <bits/move.h> is a c++11 only header, so if any symbols are being seen in it, that's where they should come from. No test for this because mappings are non-portable. This was reported in #486.
-rw-r--r--gcc.stl.headers.imp4
-rw-r--r--iwyu_include_picker.cc4
-rw-r--r--libcxx.imp2
3 files changed, 3 insertions, 7 deletions
diff --git a/gcc.stl.headers.imp b/gcc.stl.headers.imp
index 625e448..b53e041 100644
--- a/gcc.stl.headers.imp
+++ b/gcc.stl.headers.imp
@@ -114,9 +114,7 @@
{ include: ["<tr1_impl/unordered_set>", private, "<unordered_set>", public ] },
{ include: ["<tr1_impl/utility>", private, "<tr1/utility>", public ] },
{ include: ["<tr1_impl/utility>", private, "<utility>", public ] },
- # This didn't come from the grep, but seems to be where swap()
- # is defined?
- { include: ["<bits/move.h>", private, "<algorithm>", public ] }, # for swap<>()
+ { include: ["<bits/move.h>", private, "<utility>", public ] },
# Hash and hashtable-based containers.
{ include: ["<tr1_impl/functional_hash.h>", private, "<tr1/functional>", public ] },
{ include: ["<tr1_impl/functional_hash.h>", private, "<tr1/unordered_map>", public ] },
diff --git a/iwyu_include_picker.cc b/iwyu_include_picker.cc
index 840057f..55da73a 100644
--- a/iwyu_include_picker.cc
+++ b/iwyu_include_picker.cc
@@ -662,9 +662,7 @@ const IncludeMapEntry libstdcpp_include_map[] = {
{ "<tr1_impl/unordered_set>", kPrivate, "<unordered_set>", kPublic },
{ "<tr1_impl/utility>", kPrivate, "<tr1/utility>", kPublic },
{ "<tr1_impl/utility>", kPrivate, "<utility>", kPublic },
- // This didn't come from the grep, but seems to be where swap()
- // is defined?
- { "<bits/move.h>", kPrivate, "<algorithm>", kPublic }, // for swap<>()
+ { "<bits/move.h>", kPrivate, "<utility>", kPublic },
// Hash and hashtable-based containers.
{ "<tr1_impl/functional_hash.h>", kPrivate, "<tr1/functional>", kPublic },
{ "<tr1_impl/functional_hash.h>", kPrivate, "<tr1/unordered_map>", kPublic },
diff --git a/libcxx.imp b/libcxx.imp
index 7b1b61c..b65202a 100644
--- a/libcxx.imp
+++ b/libcxx.imp
@@ -4,7 +4,7 @@
{ include: ["<__mutex_base>", private, "<mutex>", public ] },
{ symbol: [ "std::declval", private, "<utility>", public ] },
{ symbol: [ "std::forward", private, "<utility>", public ] },
- { symbol: [ "std::move", private, "<algorithm>", public ] },
+ { symbol: [ "std::move", private, "<utility>", public ] },
{ symbol: [ "std::nullptr_t", private, "<cstddef>", public ] },
{ symbol: [ "std::string", private, "<string>", public ] },
]