Skip to content

[libc++][modules] Support using the module std with -fno-char8_t. #79155

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 30, 2024

Conversation

poyaoc97
Copy link
Member

Exclude some using-declarations in the module purview when compiling with -fno-char8_t.

Exclude some using-declarations in the module purview to support -fno-char8_t.
@poyaoc97 poyaoc97 requested a review from a team as a code owner January 23, 2024 15:30
@llvmbot llvmbot added the libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. label Jan 23, 2024
@llvmbot
Copy link
Member

llvmbot commented Jan 23, 2024

@llvm/pr-subscribers-libcxx

Author: Po-yao Chang (poyaoc97)

Changes

Exclude some using-declarations in the module purview when compiling with -fno-char8_t.


Full diff: https://github.com/llvm/llvm-project/pull/79155.diff

4 Files Affected:

  • (modified) libcxx/modules/std/atomic.inc (+2)
  • (modified) libcxx/modules/std/iosfwd.inc (+2)
  • (modified) libcxx/modules/std/string.inc (+4)
  • (modified) libcxx/modules/std/string_view.inc (+2)
diff --git a/libcxx/modules/std/atomic.inc b/libcxx/modules/std/atomic.inc
index 5139b7531093d7a..88b31ccdb208409 100644
--- a/libcxx/modules/std/atomic.inc
+++ b/libcxx/modules/std/atomic.inc
@@ -60,7 +60,9 @@ export namespace std {
   using std::atomic_char;
   using std::atomic_char16_t;
   using std::atomic_char32_t;
+#ifndef _LIBCPP_HAS_NO_CHAR8_T
   using std::atomic_char8_t;
+#endif
   using std::atomic_int;
   using std::atomic_llong;
   using std::atomic_long;
diff --git a/libcxx/modules/std/iosfwd.inc b/libcxx/modules/std/iosfwd.inc
index ec8b434ca0c51b7..410fb6aefed8015 100644
--- a/libcxx/modules/std/iosfwd.inc
+++ b/libcxx/modules/std/iosfwd.inc
@@ -14,7 +14,9 @@ export namespace std {
 #endif
   using std::u16streampos;
   using std::u32streampos;
+#ifndef _LIBCPP_HAS_NO_CHAR8_T
   using std::u8streampos;
+#endif
 
   using std::basic_osyncstream;
   using std::basic_syncbuf;
diff --git a/libcxx/modules/std/string.inc b/libcxx/modules/std/string.inc
index c83ee7643f87e9a..9808a96215a1829 100644
--- a/libcxx/modules/std/string.inc
+++ b/libcxx/modules/std/string.inc
@@ -34,7 +34,9 @@ export namespace std {
   using std::string;
   using std::u16string;
   using std::u32string;
+#ifndef _LIBCPP_HAS_NO_CHAR8_T
   using std::u8string;
+#endif
 #ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
   using std::wstring;
 #endif
@@ -58,7 +60,9 @@ export namespace std {
     using std::pmr::string;
     using std::pmr::u16string;
     using std::pmr::u32string;
+#ifndef _LIBCPP_HAS_NO_CHAR8_T
     using std::pmr::u8string;
+#endif
 #ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
     using std::pmr::wstring;
 #endif
diff --git a/libcxx/modules/std/string_view.inc b/libcxx/modules/std/string_view.inc
index 1fa63a77395358a..f4f9d80ddb83da5 100644
--- a/libcxx/modules/std/string_view.inc
+++ b/libcxx/modules/std/string_view.inc
@@ -27,7 +27,9 @@ export namespace std {
   using std::string_view;
   using std::u16string_view;
   using std::u32string_view;
+#ifndef _LIBCPP_HAS_NO_CHAR8_T
   using std::u8string_view;
+#endif
 #ifndef _LIBCPP_HAS_NO_WIDE_CHARACTERS
   using std::wstring_view;
 #endif

Copy link
Member

@mordante mordante left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, LGTM!

@poyaoc97 poyaoc97 merged commit dc44836 into llvm:main Jan 30, 2024
@mordante
Copy link
Member

mordante commented Feb 2, 2024

/cherry-pick dc44836

@llvmbot
Copy link
Member

llvmbot commented Feb 2, 2024

/cherry-pick dc44836

Error: Command failed due to missing milestone.

@poyaoc97 poyaoc97 added this to the LLVM 18.X Release milestone Feb 2, 2024
@poyaoc97
Copy link
Member Author

poyaoc97 commented Feb 2, 2024

/cherry-pick dc44836

llvmbot pushed a commit to llvmbot/llvm-project that referenced this pull request Feb 2, 2024
…vm#79155)

Exclude some using-declarations in the module purview when compiling
with `-fno-char8_t`.

(cherry picked from commit dc44836)
@llvmbot
Copy link
Member

llvmbot commented Feb 2, 2024

/pull-request #80484

tstellar pushed a commit to tstellar/llvm-project that referenced this pull request Feb 14, 2024
…vm#79155)

Exclude some using-declarations in the module purview when compiling
with `-fno-char8_t`.

(cherry picked from commit dc44836)
tstellar pushed a commit to tstellar/llvm-project that referenced this pull request Feb 14, 2024
…vm#79155)

Exclude some using-declarations in the module purview when compiling
with `-fno-char8_t`.

(cherry picked from commit dc44836)
tstellar pushed a commit to tstellar/llvm-project that referenced this pull request Feb 14, 2024
…vm#79155)

Exclude some using-declarations in the module purview when compiling
with `-fno-char8_t`.

(cherry picked from commit dc44836)
tstellar pushed a commit to tstellar/llvm-project that referenced this pull request Feb 14, 2024
…vm#79155)

Exclude some using-declarations in the module purview when compiling
with `-fno-char8_t`.

(cherry picked from commit dc44836)
@pointhex pointhex mentioned this pull request May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi.
Projects
Development

Successfully merging this pull request may close these issues.

3 participants