Issue 71871
Summary libc++ `put_time` outputs in wrong language on OpenBSD 7.4
Labels libc++
Assignees
Reporter seanm
    On OpenBSD 7.4 (newest) on x86_64 with its default / built-in clang:

```
$ clang++ --version
OpenBSD clang version 13.0.0
Target: amd64-unknown-openbsd7.4
Thread model: posix
InstalledDir: /usr/bin
```

This reduced C++ case:

```c++
#include <ctime>
#include <iomanip>
#include <iostream>

int main() {
  std::time_t t = std::time(nullptr);
 std::cout.imbue(std::locale("es_ES.UTF-8"));
  std::cout << std::put_time(std::localtime(&t), "%a");
}
```

When run on a Tuesday, gives "Tue".  It should be outputting "mar", for Spanish "martes" (meaning Tuesday).  That's what I get with macOS and FreeBSD.

Giving the output in the wrong language looks like a bug. It should either respect the locale or give an error (https://godbolt.org/z/KoW8YPqfc) when constructing an unsupported locale.

I don't know if this is a libc++ bug or an OpenBSD bug...


_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to