Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
e4e9e63
Implement P1885R12
smallp-o-p May 24, 2025
23e9eda
Unimplement environment() and environment_is() for now
smallp-o-p May 24, 2025
029d3dc
Move impl into type, text_encoding will be a wrapper over it, also im…
smallp-o-p Nov 9, 2025
2dcca38
nl_langinfo_l for bsd-likes
smallp-o-p Nov 9, 2025
6a548a3
misspelled environment()
smallp-o-p Nov 9, 2025
52eeac3
environment() windows
smallp-o-p Nov 9, 2025
178937f
Expose only __te_impl::__environment() to ABI
smallp-o-p Nov 9, 2025
a27271d
Update Linux abilist
smallp-o-p Nov 9, 2025
2403d26
Tests + formatting
smallp-o-p Nov 9, 2025
f26743c
Move macros and include around
smallp-o-p Nov 9, 2025
0a66fa5
picolibc + android patch + bsd_like
smallp-o-p Nov 9, 2025
c6e4f11
Simplify internal environment implementation
smallp-o-p Nov 9, 2025
f486964
guard environment behind localization
smallp-o-p Nov 9, 2025
8fb9026
Android won't support environment()
smallp-o-p Nov 9, 2025
0d9cb40
Add cxx03 transitive includes
smallp-o-p Nov 9, 2025
d9c8436
Use environment() and environment_is() stubs for android
smallp-o-p Nov 9, 2025
4fec442
Add android abi list
smallp-o-p Nov 9, 2025
27a1116
Update tests
smallp-o-p Nov 10, 2025
25dbac4
freebsd abi list
smallp-o-p Nov 10, 2025
f2429cc
Transitive includes
smallp-o-p Nov 10, 2025
e2da8ac
Come up with a better iterator test
smallp-o-p Nov 10, 2025
543e24b
Formatting
smallp-o-p Nov 10, 2025
b1b2117
Test compile failures
smallp-o-p Nov 10, 2025
c21239d
Environment tests based on platform
smallp-o-p Nov 11, 2025
7bf8ad6
Aliases view and iterator tests
smallp-o-p Nov 11, 2025
445b4c0
Simplify preprocessor conditionals in header
smallp-o-p Nov 11, 2025
56ea85c
Update intenral environment test
smallp-o-p Nov 11, 2025
af7aff5
Clean up tests
smallp-o-p Nov 11, 2025
3ec0136
Miscellaneous items
smallp-o-p Nov 11, 2025
e5e468e
Fix tests for modules
smallp-o-p Nov 11, 2025
a8a8a66
Clean up tests + fix gcc failure
smallp-o-p Nov 11, 2025
5430329
Cxx14 transitive includes
smallp-o-p Nov 11, 2025
b4997be
Add hash tests + trivially copyable test
smallp-o-p Nov 11, 2025
884976a
Add more constexpr steps for hardened modes
smallp-o-p Nov 12, 2025
c3a0cea
abi lists
smallp-o-p Nov 12, 2025
bdb0ff5
Use proper windows header in source file, simplify preprocessor ifdefs
smallp-o-p Nov 12, 2025
deb3209
Formatting
smallp-o-p Nov 12, 2025
dd0d2be
Change tests so they're more in line with the current style
smallp-o-p Nov 12, 2025
f38944b
Windows fixes
smallp-o-p Nov 12, 2025
730429d
Typo
smallp-o-p Nov 12, 2025
4ef04e0
Typo 2
smallp-o-p Nov 12, 2025
5daa96c
Add more steps for gcc
smallp-o-p Nov 12, 2025
b92c58a
Compare content of front() instead of addresses
smallp-o-p Nov 12, 2025
ab83b0c
Add LLVM 22 availability annotation
smallp-o-p Nov 12, 2025
8aa5bdc
Python formatting
smallp-o-p Nov 13, 2025
348a419
AIX abi
smallp-o-p Nov 13, 2025
429a3e8
Use the availability macro properly(?)
smallp-o-p Nov 13, 2025
8c64ac1
ditto
smallp-o-p Nov 13, 2025
60be566
Clean up test comments
smallp-o-p Nov 14, 2025
340cee1
Use type names
smallp-o-p Nov 14, 2025
3ce357f
bool -> void where possible, fix more comments
smallp-o-p Nov 14, 2025
9dc6b85
Rename a test
smallp-o-p Nov 14, 2025
6e8f75e
Uglify [[nodiscard]]s
smallp-o-p Nov 14, 2025
fdab752
Deuglify [[nodiscard]] on public interface
smallp-o-p Nov 16, 2025
67b7161
Clean up THOUSANDS_SEP handling
smallp-o-p Nov 16, 2025
90962e4
Fix a comment
smallp-o-p Nov 16, 2025
e457d41
Move nodiscard tests to test/libcxx
smallp-o-p Nov 16, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion libcxx/docs/FeatureTestMacroTable.rst
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ Status
---------------------------------------------------------- -----------------
``__cpp_lib_submdspan`` *unimplemented*
---------------------------------------------------------- -----------------
``__cpp_lib_text_encoding`` *unimplemented*
``__cpp_lib_text_encoding`` ``202306L``
---------------------------------------------------------- -----------------
``__cpp_lib_to_chars`` *unimplemented*
---------------------------------------------------------- -----------------
Expand Down
4 changes: 2 additions & 2 deletions libcxx/docs/Status/Cxx2cPapers.csv
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"`P2013R5 <https://wg21.link/P2013R5>`__","Freestanding Language: Optional ``::operator new``","2023-06 (Varna)","","","`#105370 <https://github.com/llvm/llvm-project/issues/105370>`__",""
"`P2363R5 <https://wg21.link/P2363R5>`__","Extending associative containers with the remaining heterogeneous overloads","2023-06 (Varna)","","","`#105371 <https://github.com/llvm/llvm-project/issues/105371>`__",""
"`P1901R2 <https://wg21.link/P1901R2>`__","Enabling the Use of ``weak_ptr`` as Keys in Unordered Associative Containers","2023-06 (Varna)","","","`#105372 <https://github.com/llvm/llvm-project/issues/105372>`__",""
"`P1885R12 <https://wg21.link/P1885R12>`__","Naming Text Encodings to Demystify Them","2023-06 (Varna)","","","`#105373 <https://github.com/llvm/llvm-project/issues/105373>`__",""
"`P1885R12 <https://wg21.link/P1885R12>`__","Naming Text Encodings to Demystify Them","2023-06 (Varna)","|Partial|","22","`#105373 <https://github.com/llvm/llvm-project/issues/105373>`__",""
"`P0792R14 <https://wg21.link/P0792R14>`__","``function_ref``: a type-erased callable reference","2023-06 (Varna)","","","`#105376 <https://github.com/llvm/llvm-project/issues/105376>`__",""
"`P2874R2 <https://wg21.link/P2874R2>`__","P2874R2: Mandating Annex D Require No More","2023-06 (Varna)","|Complete|","12","`#105377 <https://github.com/llvm/llvm-project/issues/105377>`__",""
"`P2757R3 <https://wg21.link/P2757R3>`__","Type-checking format args","2023-06 (Varna)","","","`#105378 <https://github.com/llvm/llvm-project/issues/105378>`__",""
Expand Down Expand Up @@ -79,7 +79,7 @@
"`P3136R1 <https://wg21.link/P3136R1>`__","Retiring niebloids","2024-11 (Wrocław)","|Complete|","14","`#118133 <https://github.com/llvm/llvm-project/issues/118133>`__",""
"`P3138R5 <https://wg21.link/P3138R5>`__","``views::cache_latest``","2024-11 (Wrocław)","","","`#118134 <https://github.com/llvm/llvm-project/issues/118134>`__",""
"`P3379R0 <https://wg21.link/P3379R0>`__","Constrain ``std::expected`` equality operators","2024-11 (Wrocław)","|Complete|","21","`#118135 <https://github.com/llvm/llvm-project/issues/118135>`__",""
"`P2862R1 <https://wg21.link/P2862R1>`__","``text_encoding::name()`` should never return null values","2024-11 (Wrocław)","","","`#118371 <https://github.com/llvm/llvm-project/issues/118371>`__",""
"`P2862R1 <https://wg21.link/P2862R1>`__","``text_encoding::name()`` should never return null values","2024-11 (Wrocław)","|Complete|","22","`#118371 <https://github.com/llvm/llvm-project/issues/118371>`__",""
"`P2897R7 <https://wg21.link/P2897R7>`__","``aligned_accessor``: An ``mdspan`` accessor expressing pointer over-alignment","2024-11 (Wrocław)","|Complete|","21","`#118372 <https://github.com/llvm/llvm-project/issues/118372>`__",""
"`P3355R2 <https://wg21.link/P3355R2>`__","Fix ``submdspan`` for C++26","2024-11 (Wrocław)","","","`#118373 <https://github.com/llvm/llvm-project/issues/118373>`__",""
"`P3222R0 <https://wg21.link/P3222R0>`__","Fix C++26 by adding transposed special cases for P2642 layouts","2024-11 (Wrocław)","","","`#118374 <https://github.com/llvm/llvm-project/issues/118374>`__",""
Expand Down
2 changes: 2 additions & 0 deletions libcxx/include/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -768,6 +768,7 @@ set(files
__system_error/error_condition.h
__system_error/system_error.h
__system_error/throw_system_error.h
__text_encoding/te_impl.h
__thread/formatter.h
__thread/id.h
__thread/jthread.h
Expand Down Expand Up @@ -1078,6 +1079,7 @@ set(files
strstream
syncstream
system_error
text_encoding
tgmath.h
thread
tuple
Expand Down
11 changes: 11 additions & 0 deletions libcxx/include/__configuration/availability.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@
// in all versions of the library are available.
#if !_LIBCPP_HAS_VENDOR_AVAILABILITY_ANNOTATIONS

# define _LIBCPP_INTRODUCED_IN_LLVM_22 1
# define _LIBCPP_INTRODUCED_IN_LLVM_22_ATTRIBUTE /* nothing */

# define _LIBCPP_INTRODUCED_IN_LLVM_21 1
# define _LIBCPP_INTRODUCED_IN_LLVM_21_ATTRIBUTE /* nothing */

Expand Down Expand Up @@ -112,6 +115,10 @@

// clang-format off

// LLVM 22
# define _LIBCPP_INTRODUCED_IN_LLVM_22 0
# define _LIBCPP_INTRODUCED_IN_LLVM_22_ATTRIBUTE __attribute__((unavailable))

// LLVM 21
// TODO: Fill this in
# define _LIBCPP_INTRODUCED_IN_LLVM_21 0
Expand Down Expand Up @@ -317,6 +324,10 @@
#define _LIBCPP_AVAILABILITY_HAS_BAD_FUNCTION_CALL_GOOD_WHAT_MESSAGE _LIBCPP_INTRODUCED_IN_LLVM_21
// No attribute, since we've had bad_function_call::what() in the headers before

// Controls whether the internal implementation for text_encoding::environment() -> te_impl::__environment() is available
#define _LIBCPP_AVAILABILITY_HAS_TE_ENVIRONMENT _LIBCPP_INTRODUCED_IN_LLVM_22
#define _LIBCPP_AVAILABILITY_TE_ENVIRONMENT _LIBCPP_INTRODUCED_IN_LLVM_22_ATTRIBUTE

// Define availability attributes that depend on both
// _LIBCPP_HAS_EXCEPTIONS and _LIBCPP_HAS_RTTI.
#if !_LIBCPP_HAS_EXCEPTIONS || !_LIBCPP_HAS_RTTI
Expand Down
9 changes: 8 additions & 1 deletion libcxx/include/__locale_dir/locale_base_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,7 @@
# include <__cstddef/size_t.h>
# include <__utility/forward.h>
# include <ctype.h>
# include <langinfo.h>
# include <string.h>
# include <time.h>
# if _LIBCPP_HAS_WIDE_CHARACTERS
Expand All @@ -160,6 +161,7 @@ namespace __locale {
# define _LIBCPP_MESSAGES_MASK LC_MESSAGES_MASK
# define _LIBCPP_ALL_MASK LC_ALL_MASK
# define _LIBCPP_LC_ALL LC_ALL
# define _LIBCPP_NL_CODESET CODESET

using __locale_t _LIBCPP_NODEBUG = locale_t;

Expand Down Expand Up @@ -283,7 +285,12 @@ __mbsrtowcs(wchar_t* __dest, const char** __src, size_t __len, mbstate_t* __ps,
return __libcpp_mbsrtowcs_l(__dest, __src, __len, __ps, __loc);
}
# endif // _LIBCPP_HAS_WIDE_CHARACTERS
# endif // _LIBCPP_BUILDING_LIBRARY

inline _LIBCPP_HIDE_FROM_ABI const char* __nl_langinfo_l(decltype(_LIBCPP_NL_CODESET) __item, __locale_t __loc) {
return ::nl_langinfo_l(__item, __loc);
}

# endif // _LIBCPP_BUILDING_LIBRARY

_LIBCPP_DIAGNOSTIC_PUSH
_LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wgcc-compat")
Expand Down
8 changes: 7 additions & 1 deletion libcxx/include/__locale_dir/support/bsd_like.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#include <__utility/forward.h>
#include <clocale> // std::lconv
#include <ctype.h>
#include <langinfo.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
Expand Down Expand Up @@ -46,6 +47,7 @@ namespace __locale {
#define _LIBCPP_MESSAGES_MASK LC_MESSAGES_MASK
#define _LIBCPP_ALL_MASK LC_ALL_MASK
#define _LIBCPP_LC_ALL LC_ALL
#define _LIBCPP_NL_CODESET CODESET

using __locale_t _LIBCPP_NODEBUG = ::locale_t;
#if defined(_LIBCPP_BUILDING_LIBRARY)
Expand Down Expand Up @@ -193,7 +195,11 @@ __mbsrtowcs(wchar_t* __dest, const char** __src, size_t __len, mbstate_t* __ps,
return ::mbsrtowcs_l(__dest, __src, __len, __ps, __loc);
}
# endif // _LIBCPP_HAS_WIDE_CHARACTERS
#endif // _LIBCPP_BUILDING_LIBRARY

inline _LIBCPP_HIDE_FROM_ABI const char* __nl_langinfo_l(decltype(_LIBCPP_NL_CODESET) __item, __locale_t __loc) {
return ::nl_langinfo_l(__item, __loc);
}
#endif // _LIBCPP_BUILDING_LIBRARY

_LIBCPP_DIAGNOSTIC_PUSH
_LIBCPP_CLANG_DIAGNOSTIC_IGNORED("-Wgcc-compat")
Expand Down
11 changes: 10 additions & 1 deletion libcxx/include/__locale_dir/support/linux.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include <cstdio>
#include <cstdlib>
#include <ctype.h>
#include <langinfo.h>
#include <stdarg.h>
#include <string.h>
#include <time.h>
Expand Down Expand Up @@ -57,6 +58,7 @@ struct __locale_guard {
#define _LIBCPP_MESSAGES_MASK LC_MESSAGES_MASK
#define _LIBCPP_ALL_MASK LC_ALL_MASK
#define _LIBCPP_LC_ALL LC_ALL
#define _LIBCPP_NL_CODESET CODESET

using __locale_t _LIBCPP_NODEBUG = ::locale_t;

Expand Down Expand Up @@ -234,7 +236,14 @@ __mbsrtowcs(wchar_t* __dest, const char** __src, size_t __len, mbstate_t* __ps,
return std::mbsrtowcs(__dest, __src, __len, __ps);
}
# endif // _LIBCPP_HAS_WIDE_CHARACTERS
#endif // _LIBCPP_BUILDING_LIBRARY

// TODO: Android has langinfo.h but not nl_langinfo_l
# ifndef __ANDROID__
inline _LIBCPP_HIDE_FROM_ABI const char* __nl_langinfo_l(decltype(_LIBCPP_NL_CODESET) __item, __locale_t __loc) {
return ::nl_langinfo_l(__item, __loc);
}
# endif
#endif // _LIBCPP_BUILDING_LIBRARY

#ifndef _LIBCPP_COMPILER_GCC // GCC complains that this can't be always_inline due to C-style varargs
_LIBCPP_HIDE_FROM_ABI
Expand Down
Loading
Loading