[libcxx-commits] [libcxx] [libc++](NFC) fix wrong __has_include (PR #141328)

Tomohiro Kashiwada via libcxx-commits libcxx-commits at lists.llvm.org
Sat May 24 17:17:37 PDT 2025


https://github.com/kikairoya updated https://github.com/llvm/llvm-project/pull/141328

>From 860f2ac4a2b5a7f4e0f7dbfd135d6452b56bb248 Mon Sep 17 00:00:00 2001
From: kikairoya <kikairoya at gmail.com>
Date: Sat, 24 May 2025 12:22:43 +0900
Subject: [PATCH] [libc++](NFC) Remove unused include caused by wrong
 __has_include

The parameter passed to __has_include has to be quoted by `<>` or `"`, not both.
Due to this typo, the guarded header is never included.
No problem has been reported by unconditionally skip of including, so it
would be safe to simply remove the conditionally include block.
---
 libcxx/src/locale.cpp | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/libcxx/src/locale.cpp b/libcxx/src/locale.cpp
index d981d137cf1ba..f2d3fa0b0d6b7 100644
--- a/libcxx/src/locale.cpp
+++ b/libcxx/src/locale.cpp
@@ -34,10 +34,6 @@
 #  define _CTYPE_DISABLE_MACROS
 #endif
 
-#if __has_include("<langinfo.h>")
-#  include <langinfo.h>
-#endif
-
 #include "include/atomic_support.h"
 #include "include/sso_allocator.h"
 



More information about the libcxx-commits mailing list