[llvm-branch-commits] [libcxx] 2641da8 - [libc++][Modules] locale fails to compile with clang modules when _LIBCPP_LOCALE__L_EXTENSIONS is undefined

Tobias Hieta via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Sun Aug 27 01:57:30 PDT 2023


Author: Ian Anderson
Date: 2023-08-27T10:55:37+02:00
New Revision: 2641da8e1057d943b79bc4ea906ee6804ea9dace

URL: https://github.com/llvm/llvm-project/commit/2641da8e1057d943b79bc4ea906ee6804ea9dace
DIFF: https://github.com/llvm/llvm-project/commit/2641da8e1057d943b79bc4ea906ee6804ea9dace.diff

LOG: [libc++][Modules] locale fails to compile with clang modules when _LIBCPP_LOCALE__L_EXTENSIONS is undefined

When `__locale_dir/locale_base_api/locale_guard.h is` compiled independently, as it is when it's in its own clang module, it fails to compile due to `locale_t` being undefined. It needs to include `__locale` to get that, instead of just `clocale`.

Reviewed By: ldionne, #libc

Differential Revision: https://reviews.llvm.org/D158669

(cherry picked from commit 6021c78fe55e3c4d3e073710bfe279c6a28566d4)

Added: 
    

Modified: 
    libcxx/include/__locale_dir/locale_base_api/locale_guard.h

Removed: 
    


################################################################################
diff  --git a/libcxx/include/__locale_dir/locale_base_api/locale_guard.h b/libcxx/include/__locale_dir/locale_base_api/locale_guard.h
index 0e2e91af7d1905..5946ed698e0fdc 100644
--- a/libcxx/include/__locale_dir/locale_base_api/locale_guard.h
+++ b/libcxx/include/__locale_dir/locale_base_api/locale_guard.h
@@ -10,6 +10,7 @@
 #define _LIBCPP___LOCALE_LOCALE_BASE_API_LOCALE_GUARD_H
 
 #include <__config>
+#include <__locale> // for locale_t
 #include <clocale>
 
 #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)


        


More information about the llvm-branch-commits mailing list