Skip to content

Commit bd74f73

Browse files
poyaoc97tstellar
authored andcommitted
[libc++][modules] Support using the module std with -fno-char8_t. (llvm#79155)
Exclude some using-declarations in the module purview when compiling with `-fno-char8_t`. (cherry picked from commit dc44836)
1 parent fa464f7 commit bd74f73

File tree

4 files changed

+10
-0
lines changed

4 files changed

+10
-0
lines changed

libcxx/modules/std/atomic.inc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,9 @@ export namespace std {
6060
using std::atomic_char;
6161
using std::atomic_char16_t;
6262
using std::atomic_char32_t;
63+
#ifndef _LIBCPP_HAS_NO_CHAR8_T
6364
using std::atomic_char8_t;
65+
#endif
6466
using std::atomic_int;
6567
using std::atomic_llong;
6668
using std::atomic_long;

libcxx/modules/std/iosfwd.inc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ export namespace std {
1414
#endif
1515
using std::u16streampos;
1616
using std::u32streampos;
17+
#ifndef _LIBCPP_HAS_NO_CHAR8_T
1718
using std::u8streampos;
19+
#endif
1820

1921
using std::basic_osyncstream;
2022
using std::basic_syncbuf;

libcxx/modules/std/string.inc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ export namespace std {
3434
using std::string;
3535
using std::u16string;
3636
using std::u32string;
37+
#ifndef _LIBCPP_HAS_NO_CHAR8_T
3738
using std::u8string;
39+
#endif
3840
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
3941
using std::wstring;
4042
#endif
@@ -58,7 +60,9 @@ export namespace std {
5860
using std::pmr::string;
5961
using std::pmr::u16string;
6062
using std::pmr::u32string;
63+
#ifndef _LIBCPP_HAS_NO_CHAR8_T
6164
using std::pmr::u8string;
65+
#endif
6266
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
6367
using std::pmr::wstring;
6468
#endif

libcxx/modules/std/string_view.inc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@ export namespace std {
2727
using std::string_view;
2828
using std::u16string_view;
2929
using std::u32string_view;
30+
#ifndef _LIBCPP_HAS_NO_CHAR8_T
3031
using std::u8string_view;
32+
#endif
3133
#ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
3234
using std::wstring_view;
3335
#endif

0 commit comments

Comments
 (0)