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

Hubert Tong via libcxx-commits libcxx-commits at lists.llvm.org
Thu May 16 14:40:48 PDT 2024


https://github.com/hubert-reinterpretcast created https://github.com/llvm/llvm-project/pull/92461

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

>From f04af69527202a37a3110767afab723b2453297b Mon Sep 17 00:00:00 2001
From: Hubert Tong <hubert-reinterpretcast at users.noreply.github.com>
Date: Thu, 16 May 2024 17:40:28 -0400
Subject: [PATCH] [libcxx] locale.cpp: Move build_name helper into unnamed
 namespace

Fix linkage of `build_name`; it is not supposed to have external linkage.
---
 libcxx/src/locale.cpp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

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;



More information about the libcxx-commits mailing list