[libcxx-commits] [libcxx] 6021c78 - [libc++][Modules] locale fails to compile with clang modules when _LIBCPP_LOCALE__L_EXTENSIONS is undefined

Ian Anderson via libcxx-commits libcxx-commits at lists.llvm.org
Thu Aug 24 14:22:47 PDT 2023


Author: Ian Anderson
Date: 2023-08-24T14:22:41-07:00
New Revision: 6021c78fe55e3c4d3e073710bfe279c6a28566d4

URL: https://github.com/llvm/llvm-project/commit/6021c78fe55e3c4d3e073710bfe279c6a28566d4
DIFF: https://github.com/llvm/llvm-project/commit/6021c78fe55e3c4d3e073710bfe279c6a28566d4.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

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 libcxx-commits mailing list