[libcxx-commits] [libcxx] [libcxx] locale.cpp: Move build_name helper into unnamed namespace (PR #92461)

via libcxx-commits libcxx-commits at lists.llvm.org
Thu May 16 14:41:16 PDT 2024


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-libcxx

Author: Hubert Tong (hubert-reinterpretcast)

<details>
<summary>Changes</summary>

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
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;

``````````

</details>


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


More information about the libcxx-commits mailing list