Skip to content

Incorrect include-what-you-use (IWYU) mappings file for libcxx 16 #63346

Closed
@percona-ysorokin

Description

@percona-ysorokin

libcxx/include/libcxx.imp IWYU mappings file has several incorrect entries referring non-existing #include <> files:

I suggest the following mappings for __fwd/*:

diff --git a/libcxx_clang16.imp b/libcxx_clang16_fixed.imp
index 575ce0f..f818891 100644
--- a/libcxx_clang16.imp
+++ b/libcxx_clang16_fixed.imp
@@ -27,7 +27,16 @@
   { include: [ "@<__filesystem/.*>", "private", "<filesystem>", "public" ] },
   { include: [ "@<__format/.*>", "private", "<format>", "public" ] },
   { include: [ "@<__functional/.*>", "private", "<functional>", "public" ] },
-  { include: [ "@<__fwd/.*>", "private", "<fwd>", "public" ] },
+  { include: [ "<__fwd/array.h>", "private", "<array>", "public" ] },
+  { include: [ "<__fwd/get.h>", "private", "<tuple>", "public" ] },
+  { include: [ "<__fwd/hash.h>", "private", "<functional>", "public" ] },
+  { include: [ "<__fwd/memory_resource.h>", "private", "<memory_resource>", "public" ] },
+  { include: [ "<__fwd/pair.h>", "private", "<utility>", "public" ] },
+  { include: [ "<__fwd/span.h>", "private", "<span>", "public" ] },
+  { include: [ "<__fwd/string.h>", "private", "<string>", "public" ] },
+  { include: [ "<__fwd/string_view.h>", "private", "<string_view>", "public" ] },
+  { include: [ "<__fwd/subrange.h>", "private", "<ranges>", "public" ] },
+  { include: [ "<__fwd/tuple.h>", "private", "<tuple>", "public" ] },
   { include: [ "@<__ios/.*>", "private", "<ios>", "public" ] },
   { include: [ "@<__iterator/.*>", "private", "<iterator>", "public" ] },
   { include: [ "@<__memory/.*>", "private", "<memory>", "public" ] },

__debug_utils/* has only one file randomize_range.h, which is used only in 3 algorithms: std::partial_sort, std::nth_element and std::sort, so most probably __debug_utils/randomize_range.h should be mapped to <algorithm>.

__support/* are included either from __locale or from __threading support, so public headers for them should be either <thread> (for __support_ibm_nanosleep.h) or <locale> (for everything else).

Metadata

Metadata

Assignees

Labels

libc++libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions