diff options
author | Brad King <brad.king@kitware.com> | 2018-08-07 12:18:25 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2018-08-07 16:04:58 (GMT) |
commit | aefb8559dca283b81d20a3f40afc8f39e6161ecb (patch) | |
tree | e77c6db11f97208b77b9d624e0aadf7e3995502d /Source | |
parent | 276d3c7afe45f26232cf1e9664ad34037d28a52a (diff) | |
download | CMake-aefb8559dca283b81d20a3f40afc8f39e6161ecb.zip CMake-aefb8559dca283b81d20a3f40afc8f39e6161ecb.tar.gz CMake-aefb8559dca283b81d20a3f40afc8f39e6161ecb.tar.bz2 |
IWYU: Fix workaround mapping for std::hash
It is provided by `functional`, not `utility`. Fix the mapping added by
commit 276d3c7afe (IWYU: Add workaround mapping for std::hash,
2018-07-31). Also generalize the workaround from commit v3.12.0-rc1~39^2~1
(IWYU: Define a macro to tell code it is preprocessing for iwyu,
2018-05-25) to allow local builds to configure specific flags. This
is needed because iwyu behaves differently in different environments.
Diffstat (limited to 'Source')
-rw-r--r-- | Source/cmFindPackageCommand.h | 5 | ||||
-rw-r--r-- | Source/cmServerProtocol.cxx | 1 |
2 files changed, 2 insertions, 4 deletions
diff --git a/Source/cmFindPackageCommand.h b/Source/cmFindPackageCommand.h index d8c7ab3..48f17ef 100644 --- a/Source/cmFindPackageCommand.h +++ b/Source/cmFindPackageCommand.h @@ -7,6 +7,7 @@ #include "cm_kwiml.h" #include <cstddef> +#include <functional> #include <map> #include <set> #include <string> @@ -15,14 +16,12 @@ // IWYU insists we should forward-declare instead of including <functional>, // but we cannot forward-declare reliably because some C++ standard libraries // put the template in an inline namespace. -#ifdef CMAKE_IWYU +#ifdef CMAKE_IWYU_FORWARD_STD_HASH /* clang-format off */ namespace std { template <class T> struct hash; } /* clang-format on */ -#else -# include <functional> #endif #include "cmFindCommon.h" diff --git a/Source/cmServerProtocol.cxx b/Source/cmServerProtocol.cxx index b05eac4..c267160 100644 --- a/Source/cmServerProtocol.cxx +++ b/Source/cmServerProtocol.cxx @@ -37,7 +37,6 @@ #include <set> #include <string> #include <unordered_map> -#include <utility> #include <vector> // Get rid of some windows macros: |