On Thu, Oct 29, 2026 at 11:10 AM Jonathan Wakely <[email protected]> wrote:
> I think "cannot locate time zone" is better than "cannot locate zone".
> If an application shows this message to a user then mentioning "time
> zone" is more user-friendly than expecting people to recognise what
> "std::chrono::tzdb" means. That class name is only meaningful to C++
> developers.
>
> Furthmore, if the application removes the "std::chrono::tzdb: " prefix
> then this leaves a reasonable descriptive message that isn't too
> cryptic.
>
> libstdc++-v3/ChangeLog:
>
> * src/c++20/tzdb.cc (tzdb::locate_zone): Adjust exception text
> to say "time zone".
> * testsuite/std/time/tzdb/links.cc: Adjust expected exception
> text.
> ---
>
> Tested std/time/tzdb/* and full tests running now on x86_64-linux.
>
LGTM.
>
> libstdc++-v3/src/c++20/tzdb.cc | 2 +-
> libstdc++-v3/testsuite/std/time/tzdb/links.cc | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/libstdc++-v3/src/c++20/tzdb.cc
> b/libstdc++-v3/src/c++20/tzdb.cc
> index 2ebfb9a14d52..65dbad4599d3 100644
> --- a/libstdc++-v3/src/c++20/tzdb.cc
> +++ b/libstdc++-v3/src/c++20/tzdb.cc
> @@ -2322,7 +2322,7 @@ constinit tzdb_list::_Node::NumLeapSeconds
> tzdb_list::_Node::num_leap_seconds;
> {
> if (auto tz = do_locate_zone(zones, links, tz_name))
> return tz;
> - string_view err = "std::chrono::tzdb: cannot locate zone: ";
> + string_view err = "std::chrono::tzdb: cannot locate time zone: ";
> string str;
> str.reserve(err.size() + tz_name.size());
> str += err;
> diff --git a/libstdc++-v3/testsuite/std/time/tzdb/links.cc
> b/libstdc++-v3/testsuite/std/time/tzdb/links.cc
> index 0ba214846c6e..8d4cd9349ccb 100644
> --- a/libstdc++-v3/testsuite/std/time/tzdb/links.cc
> +++ b/libstdc++-v3/testsuite/std/time/tzdb/links.cc
> @@ -117,7 +117,7 @@ Link Cycle4_D Cycle4_A
> VERIFY( false );
> } catch (const std::runtime_error& e) {
> std::string_view what(e.what());
> - VERIFY( what.ends_with("cannot locate zone: BadLink") );
> + VERIFY( what.ends_with("cannot locate time zone: BadLink") );
> }
>
> // LinkSelf forms a link cycle with itself.
> --
> 2.56.0
>
>