https://gcc.gnu.org/bugzilla/show_bug.cgi?id=120565

            Bug ID: 120565
           Summary: Outputing sys_info, local_info as wchar_t is
                    ill-formed
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: tkaminsk at gcc dot gnu.org
  Target Milestone: ---

The compiler produces hard error from `operator<<` implementation when
sys_info/local_info is printed to wide characters ostream:
```
  std::cout << si << " " << li << std::endl; // OK
  std::wcout << si << " " << li << std::endl; // ILL-FORMED
```
https://godbolt.org/z/zMevM55rE

Consequently formatting it as wide literals leads to error:
```
  (void)std::format("{}", si);
  (void)std::format("{}", li);
  (void)std::format(L"{}", si);
  (void)std::format(L"{}", li);
```
https://godbolt.org/z/vsdhnz67q

Reply via email to