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

tst_qbytearrayview fails to compile with ubsan

    XMLWordPrintable

Details

    • 3
    • de6a004bc5 (qt/qtbase/dev) de6a004bc5 (qt/tqtc-qtbase/dev) 5711f58410 (qt/qtbase/6.3) 22455bab78 (qt/qtbase/6.2) 22455bab78 (qt/tqtc-qtbase/6.2) 5711f58410 (qt/tqtc-qtbase/6.3)
    • Team A Foundation Sprint 53, Team A Foundation Sprint 54, Team A Foundation Sprint 55

    Description

      When trying to compile tst_qbytearrayview using GCC 11.2 C++20 -fsanitize=undefined, I get:

      tests/auto/corelib/text/qbytearrayview/tst_qbytearrayview.cpp:309:23: error: non-constant condition for static assertion
        309 |         static_assert(!bv.isNull());
            |                       ^~~~~~~~~~~~
      src/corelib/text/qbytearrayview.h:318:67: error: ‘(((const char*)(& hello)) == 0)’ is not a constant expression
        318 |     [[nodiscard]] constexpr bool isNull() const noexcept { return !data(); }
            |                                                                   ^~~~~~~
      

      tst_qstringview_check, otoh, works. It seems QBAV is missing the __builtin_constant_p / std::is_const_evaluated() stuff that QSV has.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            sonakur Sona Kurazyan
            mmutz Marc Mutz
            Vladimir Minenko Vladimir Minenko
            Alex Blasche Alex Blasche
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes