authorgravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-09-13 11:34:46-07:00
committergravatar for andrew@ziglang.orgAndrew Kelley <andrew@ziglang.org> 2023-09-19 09:37:53-07:00
logc442fbf82a67740d91664674650d27ddf3cd11d6
tree8cc3648f8c87d87c2d5cf5ff3e20e3d104cee4a1
parent2145cc0dd1f5ab651c65aeafcb2e258051ed1daa

update libcxx to latest LLVM release/17.x

upstream commit 0176e8729ea4a2cff1ec6689c7620a9f37ce9904

6 files changed, 33 insertions(+), 14 deletions(-)

lib/libcxx/include/__config+25-11
......@@ -208,19 +208,16 @@
208208
209209// HARDENING {
210210
211// TODO(hardening): remove this in LLVM 18.
212// This is for backward compatibility -- make enabling `_LIBCPP_ENABLE_ASSERTIONS` (which predates hardening modes)
213// equivalent to setting the hardened mode.
214# ifdef _LIBCPP_ENABLE_ASSERTIONS
215# warning "_LIBCPP_ENABLE_ASSERTIONS is deprecated, please use _LIBCPP_ENABLE_HARDENED_MODE instead."
216# if _LIBCPP_ENABLE_ASSERTIONS != 0 && _LIBCPP_ENABLE_ASSERTIONS != 1
217# error "_LIBCPP_ENABLE_ASSERTIONS must be set to 0 or 1"
218# endif
219# if _LIBCPP_ENABLE_ASSERTIONS
220# define _LIBCPP_ENABLE_HARDENED_MODE 1
221# endif
211# ifndef _LIBCPP_ENABLE_ASSERTIONS
212# define _LIBCPP_ENABLE_ASSERTIONS _LIBCPP_ENABLE_ASSERTIONS_DEFAULT
213# endif
214# if _LIBCPP_ENABLE_ASSERTIONS != 0 && _LIBCPP_ENABLE_ASSERTIONS != 1
215# error "_LIBCPP_ENABLE_ASSERTIONS must be set to 0 or 1"
222216# endif
223217
218// NOTE: These modes are experimental and are not stable yet in LLVM 17. Please refrain from using them and use the
219// documented libc++ "safe" mode instead.
220//
224221// Enables the hardened mode which consists of all checks intended to be used in production. Hardened mode prioritizes
225222// security-critical checks that can be done with relatively little overhead in constant time. Mutually exclusive with
226223// `_LIBCPP_ENABLE_DEBUG_MODE`.
......@@ -275,6 +272,11 @@
275272# error "Only one of _LIBCPP_ENABLE_HARDENED_MODE and _LIBCPP_ENABLE_DEBUG_MODE can be enabled."
276273# endif
277274
275# if _LIBCPP_ENABLE_ASSERTIONS && (_LIBCPP_ENABLE_HARDENED_MODE || _LIBCPP_ENABLE_DEBUG_MODE)
276# error \
277 "_LIBCPP_ENABLE_ASSERTIONS is mutually exclusive with _LIBCPP_ENABLE_HARDENED_MODE and _LIBCPP_ENABLE_DEBUG_MODE."
278# endif
279
278280// Hardened mode checks.
279281
280282// clang-format off
......@@ -303,6 +305,18 @@
303305# define _LIBCPP_ASSERT_INTERNAL(expression, message) _LIBCPP_ASSERT(expression, message)
304306# define _LIBCPP_ASSERT_UNCATEGORIZED(expression, message) _LIBCPP_ASSERT(expression, message)
305307
308// Safe mode checks.
309
310# elif _LIBCPP_ENABLE_ASSERTIONS
311
312// All checks enabled.
313# define _LIBCPP_ASSERT_VALID_INPUT_RANGE(expression, message) _LIBCPP_ASSERT(expression, message)
314# define _LIBCPP_ASSERT_VALID_ELEMENT_ACCESS(expression, message) _LIBCPP_ASSERT(expression, message)
315# define _LIBCPP_ASSERT_NON_OVERLAPPING_RANGES(expression, message) _LIBCPP_ASSERT(expression, message)
316# define _LIBCPP_ASSERT_COMPATIBLE_ALLOCATOR(expression, message) _LIBCPP_ASSERT(expression, message)
317# define _LIBCPP_ASSERT_INTERNAL(expression, message) _LIBCPP_ASSERT(expression, message)
318# define _LIBCPP_ASSERT_UNCATEGORIZED(expression, message) _LIBCPP_ASSERT(expression, message)
319
306320// Disable all checks if hardening is not enabled.
307321
308322# else
lib/libcxx/include/__format/format_functions.h+3
......@@ -245,6 +245,9 @@ __handle_replacement_field(_Iterator __begin, _Iterator __end,
245245 using _CharT = iter_value_t<_Iterator>;
246246 __format::__parse_number_result __r = __format::__parse_arg_id(__begin, __end, __parse_ctx);
247247
248 if (__r.__last == __end)
249 std::__throw_format_error("The argument index should end with a ':' or a '}'");
250
248251 bool __parse = *__r.__last == _CharT(':');
249252 switch (*__r.__last) {
250253 case _CharT(':'):
lib/libcxx/include/__locale_dir/locale_base_api/locale_guard.h+1
......@@ -10,6 +10,7 @@
1010#define _LIBCPP___LOCALE_LOCALE_BASE_API_LOCALE_GUARD_H
1111
1212#include <__config>
13#include <__locale> // for locale_t
1314#include <clocale>
1415
1516#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER)
lib/libcxx/include/__type_traits/is_nothrow_constructible.h+2-1
......@@ -22,7 +22,8 @@
2222
2323_LIBCPP_BEGIN_NAMESPACE_STD
2424
25#if __has_builtin(__is_nothrow_constructible)
25// GCC is disabled due to https://gcc.gnu.org/bugzilla/show_bug.cgi?id=106611
26#if __has_builtin(__is_nothrow_constructible) && !defined(_LIBCPP_COMPILER_GCC)
2627
2728template < class _Tp, class... _Args>
2829struct _LIBCPP_TEMPLATE_VIS is_nothrow_constructible
lib/libcxx/src/chrono.cpp+1-1
......@@ -31,7 +31,7 @@
3131# include <sys/time.h> // for gettimeofday and timeval
3232#endif
3333
34#if defined(__APPLE__) || (defined(_POSIX_TIMERS) && _POSIX_TIMERS > 0)
34#if defined(__APPLE__) || defined (__gnu_hurd__) || (defined(_POSIX_TIMERS) && _POSIX_TIMERS > 0)
3535# define _LIBCPP_HAS_CLOCK_GETTIME
3636#endif
3737
lib/libcxx/src/filesystem/filesystem_clock.cpp+1-1
......@@ -29,7 +29,7 @@
2929# include <sys/time.h> // for gettimeofday and timeval
3030#endif
3131
32#if defined(__APPLE__) || (defined(_POSIX_TIMERS) && _POSIX_TIMERS > 0)
32#if defined(__APPLE__) || defined (__gnu_hurd__) || (defined(_POSIX_TIMERS) && _POSIX_TIMERS > 0)
3333# define _LIBCPP_HAS_CLOCK_GETTIME
3434#endif
3535