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

tst_qbytearrayview test gives deprecated warnings at compilation

    XMLWordPrintable

Details

    • b387537d3 (dev), fbfec48c4 (6.8), 06055fe93 (6.7)

    Description

      While compiling on macOS I've seen the following warnings:

      [2/3] Building CXX object tests/auto/corelib/text/qbytearrayview/CMakeFiles/tst_qbytearrayview.dir/tst_qbytearrayview.cpp.o
      /Users/cristian/Projects/Qt/repo/qtbase/tests/auto/corelib/text/qbytearrayview/tst_qbytearrayview.cpp:522:39: warning: 'char_traits<unsigned char>' is deprecated: char_traits<T> for T not equal to char, wchar_t, char8_t, char16_t or char32_t is non-standard and is provided for a temporary period. It will be removed in LLVM 18, so please migrate off of it. [-Wdeprecated-declarations]
      size_t size(const T *t) { return std::char_traits<T>::length(t); }
      

      I have noticed this while trying to build the test for Cosmopolitan Libc, where it fails to compile.

      The Clang/libc++ developers were serious about this warning and they've removed support for it at https://reviews.llvm.org/D157058

      Other projects were affected by this https://github.com/jtv/libpqxx/issues/738 and https://github.com/doxygen/doxygen/issues/10928

      The test needs to be updated not to use std::char_traits<std::byte>. This should be visible when trying to compile with LLVM/Clang 19! 

      Attachments

        Issue Links

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

          Activity

            People

              thiago Thiago Macieira
              cadam Cristian Adam
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes