Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-126053

QString::arg(u8' ') prefers the integral, not the QChar overload, when built in C++20

XMLWordPrintable

    • 5
    • 967736b96 (dev), 9a95c4ba4 (6.8), 88e94df35 (6.7), fe5b07d20 (tqtc/lts-6.5), fafa568a6 (tqtc/lts-6.2), 563ed822f (dev)
    • Foundation Sprint 108, Foundation Sprint 109, Foundation Sprint 110, Foundation Sprint 111, Foundation Sprint 112, Foundation Sprint 113, Foundation Sprint 114, Foundation Sprint 115, Foundation Sprint 116, Foundation Sprint 117, Foundation Sprint 118, Foundation Sprint 119, Foundation Sprint 120, Foundation Sprint 121

      QString fmt = "%1";
      assert(fmt.arg(u8' ') == " "); // FAIL: result is "32" (on C++20, on C++17, it's correctly " ")
      

      The QLatin1StringView and QStringView overloads use the multi-arg code path for this, and accept u8' ' (as a character) only in C++17 builds (due to QTBUG-124365).

        For Gerrit Dashboard: QTBUG-126053
        # Subject Branch Project Status CR V

            mmutz Marc Mutz
            mmutz Marc Mutz
            Vladimir Minenko Vladimir Minenko
            Alex Blasche Alex Blasche
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: