summaryrefslogtreecommitdiff
path: root/Utilities/IWYU
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2019-07-10 11:38:48 -0400
committerBrad King <brad.king@kitware.com>2019-07-10 11:48:56 -0400
commit71fbebd1dc3a24e2478bb5704d9ac20f36cbf704 (patch)
treedc884b3c88488e3aecf3c1676ad404bbc6756587 /Utilities/IWYU
parent4fc10431f06a07cd7ac1fafa7f3a8e633bea204c (diff)
downloadcmake-71fbebd1dc3a24e2478bb5704d9ac20f36cbf704.tar.gz
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/IWYU')
-rw-r--r--Utilities/IWYU/mapping.imp11
1 files changed, 9 insertions, 2 deletions
diff --git a/Utilities/IWYU/mapping.imp b/Utilities/IWYU/mapping.imp
index 0393ff199e..4e00214f91 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 ] },