Skip to content

Commit 9992b38

Browse files
[libc++][Modules] Remove explicit exports from modules that export *
This may be a clang bug, but explicit exports interfere with `export *`, especially in local submodule visibility mode. For example, exporting `depr.stdint_h` from `cstdint` causes std::int32_t to become an "unresolved using declaration" in LSV if `cstdint` and `stdint.h` are promoted to top level modules. This was previously worked around by exporting `Darwin.C.stdint` in `depr.stdint_h`, but that only works on Apple platforms, and it stops working when `cstdint` and `stdint.h` are promoted to top level modules. Remove all of the explicit `export` statements in modules that have `export *`. Reviewed By: ldionne, Mordante, #libc Differential Revision: https://reviews.llvm.org/D153212
1 parent 6f05da6 commit 9992b38

File tree

1 file changed

+0
-42
lines changed

1 file changed

+0
-42
lines changed

libcxx/include/module.modulemap.in

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ module std [system] {
3434
}
3535
module inttypes_h {
3636
header "inttypes.h"
37-
export stdint_h
3837
export *
3938
}
4039
// <iso646.h> provided by compiler.
@@ -77,10 +76,6 @@ module std [system] {
7776
module stdint_h {
7877
header "stdint.h"
7978
export *
80-
// FIXME: This module only exists on OS X and for some reason the
81-
// wildcard above doesn't export it. Removing this breaks the tests
82-
// for C compatibility headers in C++17 mode with modules enabled.
83-
export Darwin.C.stdint
8479
}
8580
module stdio_h {
8681
// <stdio.h>'s __need_* macros require textual inclusion.
@@ -118,7 +113,6 @@ module std [system] {
118113
// allow their use in extern "C" contexts.
119114
module complex_h {
120115
header "complex.h"
121-
export ccomplex
122116
export *
123117
}
124118
module tgmath_h {
@@ -134,7 +128,6 @@ module std [system] {
134128
}
135129
module ccomplex {
136130
header "ccomplex"
137-
export complex
138131
export *
139132
}
140133
module cctype {
@@ -155,7 +148,6 @@ module std [system] {
155148
}
156149
module cinttypes {
157150
header "cinttypes"
158-
export cstdint
159151
export *
160152
}
161153
module ciso646 {
@@ -198,7 +190,6 @@ module std [system] {
198190
}
199191
module cstdint {
200192
header "cstdint"
201-
export depr.stdint_h
202193
export *
203194
}
204195
module cstdio {
@@ -215,8 +206,6 @@ module std [system] {
215206
}
216207
module ctgmath {
217208
header "ctgmath"
218-
export ccomplex
219-
export cmath
220209
export *
221210
}
222211
module ctime {
@@ -241,7 +230,6 @@ module std [system] {
241230

242231
module algorithm {
243232
header "algorithm"
244-
export initializer_list
245233
export *
246234

247235
module __algorithm {
@@ -709,7 +697,6 @@ module std [system] {
709697
}
710698
module array {
711699
header "array"
712-
export initializer_list
713700
export *
714701

715702
module array_fwd { private header "__fwd/array.h" }
@@ -769,8 +756,6 @@ module std [system] {
769756
}
770757
module bitset {
771758
header "bitset"
772-
export string
773-
export iosfwd
774759
export *
775760
}
776761
// No submodule for cassert. It fundamentally needs repeated, textual inclusion.
@@ -926,7 +911,6 @@ module std [system] {
926911
}
927912
module deque {
928913
header "deque"
929-
export initializer_list
930914
export *
931915
}
932916
module exception {
@@ -1035,7 +1019,6 @@ module std [system] {
10351019
}
10361020
module forward_list {
10371021
header "forward_list"
1038-
export initializer_list
10391022
export *
10401023
}
10411024
module fstream {
@@ -1046,8 +1029,6 @@ module std [system] {
10461029
}
10471030
module functional {
10481031
header "functional"
1049-
// the contents of __type_traits/unwrap_ref.h should be available from functional too.
1050-
export type_traits.unwrap_ref
10511032
export *
10521033

10531034
module __functional {
@@ -1112,7 +1093,6 @@ module std [system] {
11121093
module ios {
11131094
@requires_LIBCXX_ENABLE_LOCALIZATION@
11141095
header "ios"
1115-
export iosfwd
11161096
export *
11171097

11181098
module __ios {
@@ -1134,10 +1114,6 @@ module std [system] {
11341114
module iostream {
11351115
@requires_LIBCXX_ENABLE_LOCALIZATION@
11361116
header "iostream"
1137-
export ios
1138-
export streambuf
1139-
export istream
1140-
export ostream
11411117
export *
11421118
}
11431119
module istream {
@@ -1237,7 +1213,6 @@ module std [system] {
12371213
}
12381214
module list {
12391215
header "list"
1240-
export initializer_list
12411216
export *
12421217
}
12431218
module locale {
@@ -1253,7 +1228,6 @@ module std [system] {
12531228
}
12541229
module map {
12551230
header "map"
1256-
export initializer_list
12571231
export *
12581232
}
12591233
module mdspan {
@@ -1395,12 +1369,10 @@ module std [system] {
13951369
}
13961370
module queue {
13971371
header "queue"
1398-
export initializer_list
13991372
export *
14001373
}
14011374
module random {
14021375
header "random"
1403-
export initializer_list
14041376
export *
14051377

14061378
module __random {
@@ -1454,9 +1426,6 @@ module std [system] {
14541426
}
14551427
module ranges {
14561428
header "ranges"
1457-
export compare
1458-
export initializer_list
1459-
export iterator
14601429
export *
14611430

14621431
module __ranges {
@@ -1536,7 +1505,6 @@ module std [system] {
15361505
module regex {
15371506
@requires_LIBCXX_ENABLE_LOCALIZATION@
15381507
header "regex"
1539-
export initializer_list
15401508
export *
15411509
}
15421510
module scoped_allocator {
@@ -1550,7 +1518,6 @@ module std [system] {
15501518
}
15511519
module set {
15521520
header "set"
1553-
export initializer_list
15541521
export *
15551522
}
15561523
module shared_mutex {
@@ -1576,7 +1543,6 @@ module std [system] {
15761543
}
15771544
module stack {
15781545
header "stack"
1579-
export initializer_list
15801546
export *
15811547
}
15821548
module stdexcept {
@@ -1604,8 +1570,6 @@ module std [system] {
16041570
}
16051571
module string {
16061572
header "string"
1607-
export initializer_list
1608-
export string_view
16091573
module __string {
16101574
module char_traits { private header "__string/char_traits.h" }
16111575
module constexpr_c_functions {
@@ -1909,17 +1873,14 @@ module std [system] {
19091873
}
19101874
module unordered_map {
19111875
header "unordered_map"
1912-
export initializer_list
19131876
export *
19141877
}
19151878
module unordered_set {
19161879
header "unordered_set"
1917-
export initializer_list
19181880
export *
19191881
}
19201882
module utility {
19211883
header "utility"
1922-
export initializer_list
19231884
export *
19241885

19251886
module __utility {
@@ -1974,7 +1935,6 @@ module std [system] {
19741935
}
19751936
module valarray {
19761937
header "valarray"
1977-
export initializer_list
19781938
export *
19791939
}
19801940
module variant {
@@ -1987,7 +1947,6 @@ module std [system] {
19871947
}
19881948
module vector {
19891949
header "vector"
1990-
export initializer_list
19911950
export *
19921951
}
19931952
module version {
@@ -2016,7 +1975,6 @@ module std [system] {
20161975
// This one needs to appear after __tree to work around issues with modules in Objective-C++ mode.
20171976
module coroutine {
20181977
header "coroutine"
2019-
export compare
20201978
export *
20211979

20221980
module __coroutine {

0 commit comments

Comments
 (0)