gcc/libstdc++-v3/testsuite
Jonathan Wakely 4abd5bc600 libstdc++: Make std::chrono::current_zone() default to UTC
This is consistent with the behaviour of glibc, which assumes UTC when
/etc/localtime and TZ do not identify a valid time zone. The fallback
tzdb used when no valid tzdata exists always contains the UTC zone, so
this change means we have a valid tzdb and valid current zone even in
the degenerate case.

With this default we no longer need the AIX-specific kluge to try and
identify TZ values specifying a 0-offset zone. We can just use the UTC
default for those, as it has the same effect.

It's still possible for chrono::current_zone() to fail, because the user
could have provided a custom tzdata.zi file which doesn't contain the
UTC time zone, so the "UTC" default would fail to find a valid zone, and
throw an exception. That's just user error, they should not provide bad
data and expect reasonable behaviour.

libstdc++-v3/ChangeLog:

	* src/c++20/tzdb.cc (chrono::tzdb::current_zone()) Use "UTC" if
	current time zone cannot be determined.
	* testsuite/std/time/tzdb/1.cc: Remove conditions based on
	HAVE_TZDB macro and test all members unconditionally.
2023-03-01 21:26:08 +00:00
..
17_intro [libstdc++] [testsuite] intro/names.cc: undef func on vxw7krn 2023-02-22 14:35:13 -03:00
18_support
19_diagnostics
20_util libstdc++: Fix uses_allocator_construction_args for pair<T&&, U&&> [PR108952] 2023-02-28 09:49:11 +00:00
21_strings libstdc++: Optimize basic_string move assignment 2023-02-04 14:03:54 +01:00
22_locale
23_containers libstdc++: Use dg-bogus in new test [PR108554] 2023-01-27 15:33:00 +00:00
24_iterators
25_algorithms libstdc++: Do not use memmove for 1-element ranges [PR108846] 2023-02-28 09:49:11 +00:00
26_numerics
27_io [libstdc++] xfail noreplace tests on vxworks 2023-02-22 14:35:15 -03:00
28_regex
29_atomics libstdc++: Add missing free functions for atomic_flag [PR103934] 2023-02-13 17:46:59 -08:00
30_threads
abi
backward
config
data
decimal
experimental libstdc++: Make net::ip::basic_endpoint comparisons constexpr 2023-02-24 14:23:36 +00:00
ext
lib
libstdc++-abi
libstdc++-dg
libstdc++-prettyprinters
libstdc++-xmethods
performance
special_functions
std libstdc++: Make std::chrono::current_zone() default to UTC 2023-03-01 21:26:08 +00:00
tr1
tr2
util
Makefile.am
Makefile.in