diff options
author | Brad King <brad.king@kitware.com> | 2019-07-10 15:38:48 (GMT) |
---|---|---|
committer | Brad King <brad.king@kitware.com> | 2019-07-10 15:48:56 (GMT) |
commit | 71fbebd1dc3a24e2478bb5704d9ac20f36cbf704 (patch) | |
tree | dc884b3c88488e3aecf3c1676ad404bbc6756587 /Utilities | |
parent | 4fc10431f06a07cd7ac1fafa7f3a8e633bea204c (diff) | |
download | CMake-71fbebd1dc3a24e2478bb5704d9ac20f36cbf704.zip CMake-71fbebd1dc3a24e2478bb5704d9ac20f36cbf704.tar.gz CMake-71fbebd1dc3a24e2478bb5704d9ac20f36cbf704.tar.bz2 |
IWYU: Fix handling of <memory> standard header
An old workaround for `std::allocator_traits<>::value_type` lints from
IWYU on `std::vector<>` usage breaks IWYU's handling of `<memory>`.
Convert the workaround to use the same approach we already use for a
workaround of `std::__decay_and_strip<>::::__type` lints. Then update
the `<memory>` inclusions to follow the now-correct IWYU lints.
Diffstat (limited to 'Utilities')
-rw-r--r-- | Utilities/IWYU/mapping.imp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/Utilities/IWYU/mapping.imp b/Utilities/IWYU/mapping.imp index 0393ff1..4e00214 100644 --- a/Utilities/IWYU/mapping.imp +++ b/Utilities/IWYU/mapping.imp @@ -42,10 +42,17 @@ { symbol: [ "std::istringstream", private, "<sstream>", public ] }, { symbol: [ "std::ostringstream", private, "<sstream>", public ] }, - # HACK: iwyu suggests those two files each time vector[] is used. + # HACK: iwyu suggests <ext/alloc_traits.h> and <memory> each time vector[] is used. # https://github.com/include-what-you-use/include-what-you-use/issues/166 { include: [ "<ext/alloc_traits.h>", private, "<vector>", public ] }, - { include: [ "<memory>", public, "<vector>", public ] }, + { symbol: [ "std::allocator_traits<std::allocator<cmComputeComponentGraph::TarjanEntry> >::value_type", private, "<vector>", public ] }, + { symbol: [ "std::allocator_traits<std::allocator<cmFortranFile> >::value_type", private, "<vector>", public ] }, + { symbol: [ "std::allocator_traits<std::allocator<cmGraphEdgeList> >::value_type", private, "<vector>", public ] }, + { symbol: [ "std::allocator_traits<std::allocator<cmOrderDirectories::ConflictList> >::value_type", private, "<vector>", public ] }, + { symbol: [ "std::allocator_traits<std::allocator<cmStateSnapshot> >::value_type", private, "<vector>", public ] }, + { symbol: [ "std::allocator_traits<std::allocator<std::basic_string<char> > >::value_type", private, "<vector>", public ] }, + { symbol: [ "std::allocator_traits<std::allocator<std::vector<std::basic_string<char>, std::allocator<std::basic_string<char> > > > >::value_type", private, "<vector>", public ] }, + { symbol: [ "std::allocator_traits<std::allocator<uv_stdio_container_s> >::value_type", private, "<vector>", public ] }, # TODO: enable this block and remove some <utility> includes? #{ symbol: [ "std::pair", private, "<utility>", public ] }, |