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

QString::arg(char16_t{}) prefers the integral, not the QChar overload

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 6.7
    • None
    • 8
    • a6d2e45d5 (dev), 86e180ec4 (6.7), db8901c04 (tqtc/lts-6.5), a6f01f12c (tqtc/lts-6.2), 4bb36a6e7 (dev), 3750611d6 (6.7), 3c0bd5c36 (tqtc/lts-6.5)
    • 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

    Description

      QString fmt = "%1";
      assert(fmt.arg(u' ') == " "); // FAIL: result is "32"
      

      Problem here is that we have a large historic body of code which may rely on this. Maybe we need to = delete the overload?

      The QLatin1StringView and QStringView overloads use the multi-arg code path for this, and treat char16_t as a character.

      This also means that the behaviour differs between QString::arg() and QString::multiArg().

      Attachments

        Issue Links

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

          Activity

            People

              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

              Dates

                Created:
                Updated: