| Issue |
107779
|
| Summary |
[libc++] tzdata 2024b breaks timezone parsing in std::chrcono
|
| Labels |
libc++
|
| Assignees |
|
| Reporter |
steveWang
|
```
$ clang --version
clang version 18.1.8
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /sbin
```
Reproducing code:
```
#include <chrono>
#include <iostream>
int main() {
std::cout << std::chrono::get_tzdb().current_zone()->name() << "\n";
return 0;
}
```
With tzdata-2024a, this prints out my local timezone (America/New_York) as I'd expect, but with tzdata-2024b, this prints out Etc/UTC (as it cannot find any timezones other than Etc/UTC and Etc/GMT).
I suspect this is due to a change in tzdata.zi to use %z, which the current parsing logic in [tzdb.cpp](https://github.com/llvm/llvm-project/blob/main/libcxx/src/experimental/tzdb.cpp) doesn't seem to handle at all.
> The main data form now uses %z.
https://lists.iana.org/hyperkitty/list/[email protected]/message/IZ7AO6WRE3W3TWBL5IR6PMQUL433BQIE/
I was also able to reproduce with g++, although supposedly that project added handling in https://github.com/gcc-mirror/gcc/commit/0ca8d56f2085715f27ee536c6c344bc47af49cdd (which doesn't seem to have made the cut for gcc 14.2.0).
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs