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

            Bug ID: 120114
           Summary: Format width is not correctly handled for chrono
                    formatting
           Product: gcc
           Version: 13.1.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: ---

Field width is not correctly computed when Unicode characters are included in
chrono-spec:
```
    using namespace std::chrono_literals;
    auto date = 2025y/std::chrono::May/05d;
    auto res = std::format("{:+<13%F\U0001f921}", date);
    // 2025-05-05🤡, should have 1 '+' of padding
    std::cout << res << std::endl;
    res = std::format("{:+<15%F\U0001f921}", date);
    // 2025-05-05🤡+, should have 3 '+' of padding
    std::cout << res << std::endl;
    auto wres = std::format(L"{:+<13%F\U0001f921}", date);
    // 2025-05-05🤡++, should have 1 '+' of padding
    wres = std::format(L"{:+<15%F\U0001f921}", date);
    // 2025-05-05🤡++++, should have 3 '+' of padding
```
See: https://godbolt.org/z/d3x5Gq83h

Reply via email to