Skip to content

Commit de5e4eb

Browse files
authored
[libc++] Remove transitive includes from empty headers (#116295)
This removes transitive includes that are only in a header that is empty in a given C++ version.
1 parent ca1b35a commit de5e4eb

File tree

12 files changed

+0
-503
lines changed

12 files changed

+0
-503
lines changed

libcxx/include/bit

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,6 @@ namespace std {
8787
# pragma GCC system_header
8888
#endif
8989

90-
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 17
91-
# include <cstdint>
92-
#endif
93-
9490
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
9591
# include <cstdlib>
9692
# include <iosfwd>

libcxx/include/charconv

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -101,13 +101,6 @@ _LIBCPP_BEGIN_NAMESPACE_STD
101101

102102
_LIBCPP_END_NAMESPACE_STD
103103

104-
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 14
105-
# include <cerrno>
106-
# include <cstddef>
107-
# include <initializer_list>
108-
# include <new>
109-
#endif
110-
111104
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
112105
# include <cmath>
113106
# include <concepts>

libcxx/include/compare

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -164,12 +164,6 @@ namespace std {
164164
# pragma GCC system_header
165165
#endif
166166

167-
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 17
168-
# include <cstddef>
169-
# include <cstdint>
170-
# include <limits>
171-
#endif
172-
173167
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
174168
# include <cmath>
175169
# include <cstddef>

libcxx/include/expected

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,4 @@ namespace std {
5353
# pragma GCC system_header
5454
#endif
5555

56-
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
57-
# include <cstddef>
58-
# include <initializer_list>
59-
# include <new>
60-
#endif
61-
6256
#endif // _LIBCPP_EXPECTED

libcxx/include/mdspan

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -426,13 +426,4 @@ namespace std {
426426
# pragma GCC system_header
427427
#endif
428428

429-
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
430-
# include <array>
431-
# include <cinttypes>
432-
# include <concepts>
433-
# include <cstddef>
434-
# include <limits>
435-
# include <span>
436-
#endif
437-
438429
#endif // _LIBCPP_MDSPAN

libcxx/include/memory_resource

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -66,15 +66,6 @@ namespace std::pmr {
6666
# pragma GCC system_header
6767
#endif
6868

69-
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 14
70-
# include <cstddef>
71-
# include <cstdint>
72-
# include <limits>
73-
# include <mutex>
74-
# include <new>
75-
# include <tuple>
76-
#endif
77-
7869
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
7970
# include <stdexcept>
8071
#endif

libcxx/include/ranges

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -446,14 +446,6 @@ namespace std {
446446
# pragma GCC system_header
447447
#endif
448448

449-
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 17
450-
# include <cstddef>
451-
# include <limits>
452-
# include <optional>
453-
# include <span>
454-
# include <tuple>
455-
#endif
456-
457449
#if !defined(_LIBCPP_REMOVE_TRANSITIVE_INCLUDES) && _LIBCPP_STD_VER <= 20
458450
# include <cstdlib>
459451
# include <iosfwd>

libcxx/test/libcxx/transitive_includes/cxx03.csv

Lines changed: 0 additions & 107 deletions
Original file line numberDiff line numberDiff line change
@@ -242,17 +242,14 @@ ccomplex utility
242242
ccomplex variant
243243
ccomplex vector
244244
ccomplex version
245-
charconv cerrno
246245
charconv cmath
247246
charconv concepts
248247
charconv cstddef
249248
charconv cstdint
250249
charconv cstdlib
251250
charconv cstring
252-
charconv initializer_list
253251
charconv iosfwd
254252
charconv limits
255-
charconv new
256253
charconv type_traits
257254
charconv version
258255
chrono algorithm
@@ -571,12 +568,6 @@ exception typeinfo
571568
exception version
572569
execution cstddef
573570
execution version
574-
expected cstddef
575-
expected cstdint
576-
expected cstdlib
577-
expected initializer_list
578-
expected new
579-
expected type_traits
580571
expected version
581572
experimental/iterator algorithm
582573
experimental/iterator atomic
@@ -1340,53 +1331,6 @@ map utility
13401331
map variant
13411332
map vector
13421333
map version
1343-
mdspan algorithm
1344-
mdspan array
1345-
mdspan atomic
1346-
mdspan bit
1347-
mdspan cctype
1348-
mdspan cerrno
1349-
mdspan cinttypes
1350-
mdspan climits
1351-
mdspan clocale
1352-
mdspan cmath
1353-
mdspan compare
1354-
mdspan concepts
1355-
mdspan cstdarg
1356-
mdspan cstddef
1357-
mdspan cstdint
1358-
mdspan cstdio
1359-
mdspan cstdlib
1360-
mdspan cstring
1361-
mdspan ctime
1362-
mdspan cwchar
1363-
mdspan cwctype
1364-
mdspan exception
1365-
mdspan functional
1366-
mdspan initializer_list
1367-
mdspan ios
1368-
mdspan iosfwd
1369-
mdspan iterator
1370-
mdspan limits
1371-
mdspan locale
1372-
mdspan memory
1373-
mdspan mutex
1374-
mdspan new
1375-
mdspan optional
1376-
mdspan ratio
1377-
mdspan span
1378-
mdspan stdexcept
1379-
mdspan streambuf
1380-
mdspan string
1381-
mdspan string_view
1382-
mdspan system_error
1383-
mdspan tuple
1384-
mdspan type_traits
1385-
mdspan typeinfo
1386-
mdspan unordered_map
1387-
mdspan utility
1388-
mdspan variant
1389-
mdspan vector
13901334
mdspan version
13911335
memory atomic
13921336
memory cctype
@@ -1416,42 +1360,15 @@ memory typeinfo
14161360
memory utility
14171361
memory variant
14181362
memory version
1419-
memory_resource algorithm
1420-
memory_resource atomic
1421-
memory_resource bit
1422-
memory_resource cctype
1423-
memory_resource cerrno
1424-
memory_resource climits
1425-
memory_resource cmath
1426-
memory_resource compare
1427-
memory_resource concepts
14281363
memory_resource cstddef
14291364
memory_resource cstdint
1430-
memory_resource cstdio
14311365
memory_resource cstdlib
1432-
memory_resource cstring
1433-
memory_resource ctime
1434-
memory_resource cwchar
1435-
memory_resource cwctype
14361366
memory_resource exception
1437-
memory_resource initializer_list
14381367
memory_resource iosfwd
1439-
memory_resource iterator
1440-
memory_resource limits
1441-
memory_resource memory
1442-
memory_resource mutex
14431368
memory_resource new
1444-
memory_resource optional
1445-
memory_resource ratio
14461369
memory_resource stdexcept
1447-
memory_resource string
1448-
memory_resource string_view
1449-
memory_resource system_error
1450-
memory_resource tuple
14511370
memory_resource type_traits
14521371
memory_resource typeinfo
1453-
memory_resource utility
1454-
memory_resource variant
14551372
memory_resource version
14561373
mutex algorithm
14571374
mutex atomic
@@ -1772,52 +1689,28 @@ random utility
17721689
random variant
17731690
random vector
17741691
random version
1775-
ranges algorithm
1776-
ranges array
1777-
ranges atomic
1778-
ranges bit
17791692
ranges cctype
1780-
ranges cerrno
1781-
ranges climits
1782-
ranges clocale
17831693
ranges cmath
17841694
ranges compare
17851695
ranges concepts
1786-
ranges cstdarg
17871696
ranges cstddef
17881697
ranges cstdint
17891698
ranges cstdio
17901699
ranges cstdlib
17911700
ranges cstring
1792-
ranges ctime
17931701
ranges cwchar
17941702
ranges cwctype
17951703
ranges exception
1796-
ranges functional
17971704
ranges initializer_list
1798-
ranges ios
17991705
ranges iosfwd
18001706
ranges iterator
18011707
ranges limits
1802-
ranges locale
1803-
ranges memory
1804-
ranges mutex
18051708
ranges new
1806-
ranges optional
1807-
ranges ratio
1808-
ranges span
1809-
ranges stdexcept
1810-
ranges streambuf
1811-
ranges string
1812-
ranges string_view
1813-
ranges system_error
18141709
ranges tuple
18151710
ranges type_traits
18161711
ranges typeinfo
1817-
ranges unordered_map
18181712
ranges utility
18191713
ranges variant
1820-
ranges vector
18211714
ranges version
18221715
ratio climits
18231716
ratio cstdint

0 commit comments

Comments
 (0)