Skip to content

[libcxx] locale.cpp: Move build_name helper into unnamed namespace #92461

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

Conversation

hubert-reinterpretcast
Copy link
Collaborator

Fix linkage of build_name; it is not supposed to have external linkage.

Fix linkage of `build_name`; it is not supposed to have external linkage.
@hubert-reinterpretcast hubert-reinterpretcast requested a review from a team as a code owner May 16, 2024 21:40
@llvmbot llvmbot added the libc++ libc++ C++ Standard Library. Not GNU libstdc++. Not libc++abi. label May 16, 2024
@llvmbot
Copy link
Member

llvmbot commented May 16, 2024

@llvm/pr-subscribers-libcxx

Author: Hubert Tong (hubert-reinterpretcast)

Changes

Fix linkage of build_name; it is not supposed to have external linkage.


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

1 Files Affected:

  • (modified) libcxx/src/locale.cpp (+2-2)
diff --git a/libcxx/src/locale.cpp b/libcxx/src/locale.cpp
index 1ca88e30f63ac..c5ab6de5d657a 100644
--- a/libcxx/src/locale.cpp
+++ b/libcxx/src/locale.cpp
@@ -102,8 +102,6 @@ inline constexpr size_t countof(const T* const begin, const T* const end) {
   return static_cast<size_t>(end - begin);
 }
 
-} // namespace
-
 string build_name(const string& other, const string& one, locale::category c) {
   if (other == "*" || one == "*")
     return "*";
@@ -115,6 +113,8 @@ string build_name(const string& other, const string& one, locale::category c) {
   return "*";
 }
 
+} // namespace
+
 const locale::category locale::none;
 const locale::category locale::collate;
 const locale::category locale::ctype;

Copy link

⚠️ We detected that you are using a GitHub private e-mail address to contribute to the repo.
Please turn off Keep my email addresses private setting in your account.
See LLVM Discourse for more information.

@mordante mordante self-assigned this May 20, 2024
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!

@hubert-reinterpretcast hubert-reinterpretcast merged commit 2a90d59 into main May 20, 2024
53 checks passed
@hubert-reinterpretcast hubert-reinterpretcast deleted the users/hubert-reinterpretcast/locale_cpp-build_name-linkage_fix branch May 20, 2024 14:54
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
None yet
Development

Successfully merging this pull request may close these issues.

3 participants