From 276d3c7afe45f26232cf1e9664ad34037d28a52a Mon Sep 17 00:00:00 2001 From: Brad King Date: Tue, 31 Jul 2018 09:27:29 -0400 Subject: IWYU: Add workaround mapping for std::hash When using GCC 8's standard library IWYU thinks that `` must be included to get `std::hash`. Add a mapping for ``. --- Source/cmServerProtocol.cxx | 1 + Utilities/IWYU/mapping.imp | 3 +++ 2 files changed, 4 insertions(+) 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 #include #include +#include #include // 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, "", public ] }, #{ symbol: [ "std::pair", private, "", public ] }, + # HACK: iwyu wrongly thinks that is needed for std::hash + { symbol: [ "std::hash", private, "", public ] }, + # __decay_and_strip is used internally in the C++11 standard library. # IWYU does not classify it as internal and suggests to add . # To ignore it, we simply map it to a file that is included anyway. -- cgit v0.12