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>`.
This commit is contained in:
Brad King 2018-07-31 09:27:29 -04:00
parent 72f57845d3
commit 276d3c7afe
2 changed files with 4 additions and 0 deletions

View File

@ -37,6 +37,7 @@
#include <set>
#include <string>
#include <unordered_map>
#include <utility>
#include <vector>
// Get rid of some windows macros:

View File

@ -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.