summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-07-31 13:27:29 (GMT)
committerBrad King <brad.king@kitware.com>2018-07-31 13:34:55 (GMT)
commit276d3c7afe45f26232cf1e9664ad34037d28a52a (patch)
tree0e107b4d5e613379b056f710e3c74c32370b92ed
parent72f57845d3ad8cd401ca1c847ae8dd890d40a0b8 (diff)
downloadCMake-276d3c7afe45f26232cf1e9664ad34037d28a52a.zip
CMake-276d3c7afe45f26232cf1e9664ad34037d28a52a.tar.gz
CMake-276d3c7afe45f26232cf1e9664ad34037d28a52a.tar.bz2
IWYU: Add workaround mapping for std::hash
When using GCC 8's standard library IWYU thinks that `<system_error>` must be included to get `std::hash`. Add a mapping for `<utility>`.
-rw-r--r--Source/cmServerProtocol.cxx1
-rw-r--r--Utilities/IWYU/mapping.imp3
2 files changed, 4 insertions, 0 deletions
diff --git a/Source/cmServerProtocol.cxx b/Source/cmServerProtocol.cxx
index c267160..b05eac4 100644
--- a/Source/cmServerProtocol.cxx
+++ b/Source/cmServerProtocol.cxx
@@ -37,6 +37,7 @@
#include <set>
#include <string>
#include <unordered_map>
+#include <utility>
#include <vector>
// Get rid of some windows macros:
diff --git a/Utilities/IWYU/mapping.imp b/Utilities/IWYU/mapping.imp
index 892cdcb..77bb572 100644
--- a/Utilities/IWYU/mapping.imp
+++ b/Utilities/IWYU/mapping.imp
@@ -52,6 +52,9 @@
#{ symbol: [ "std::pair", private, "<map>", public ] },
#{ symbol: [ "std::pair", private, "<set>", public ] },
+ # HACK: iwyu wrongly thinks that <system_error> is needed for std::hash
+ { symbol: [ "std::hash", private, "<utility>", public ] },
+
# __decay_and_strip is used internally in the C++11 standard library.
# IWYU does not classify it as internal and suggests to add <type_traits>.
# To ignore it, we simply map it to a file that is included anyway.