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

tst_qbytearrayview fails to compile with libc++ 19

    XMLWordPrintable

Details

    • 0cc41083c (dev), 5b10a1e8b (6.9), be3b8e6a1 (6.8)

    Description

      Attempting to compile the test with libcpp gives repeating errors that look like this:

      /usr/lib/llvm-19/bin/../include/c++/v1/string:2535:5: error: implicit instantiation of undefined template 'std::char_traits<signed char>'
       2535 |     traits_type::copy(std::__to_address(__p), std::__to_address(__old_p), __n_copy);
            |     ^
      /usr/lib/llvm-19/bin/../include/c++/v1/string:2556:3: note: in instantiation of member function 'std::basic_string<signed char>::__grow_by' requested here
       2556 |   __grow_by(__old_cap, __delta_cap, __old_sz, __n_copy, __n_del, __n_add);
            |   ^
      /usr/lib/llvm-19/bin/../include/c++/v1/string:2898:5: note: in instantiation of member function 'std::basic_string<signed char>::__grow_by_without_replace' requested here
       2898 |     __grow_by_without_replace(__cap, 1, __sz, __sz, 0);
            |     ^
      /usr/lib/llvm-19/bin/../include/c++/v1/__iterator/back_insert_iterator.h:57:16: note: in instantiation of member function 'std::basic_string<signed char>::push_back' requested here
         57 |     container->push_back(__value);
            |                ^
      /usr/lib/llvm-19/bin/../include/c++/v1/__algorithm/copy.h:40:17: note: in instantiation of member function 'std::back_insert_iterator<std::basic_string<signed char>>::operator=' requested here
         40 |       *__result = *__first;
            |                 ^
      /home/moheim/qt/qt6/qtbase/tests/auto/corelib/text/qbytearrayview/tst_qbytearrayview.cpp:716:10: note: in instantiation of function template specialization 'std::copy<const signed char *, std::back_insert_iterator<std::basic_string<signed char>>>' requested here
        716 |     std::copy(data, data + s.size(), std::back_inserter(c));
            |          ^
      /home/moheim/qt/qt6/qtbase/tests/auto/corelib/text/qbytearrayview/tst_qbytearrayview.cpp:726:5: note: in instantiationof function template specialization 'tst_QByteArrayView::fromContainer<signed char, std::basic_string<signed char>>' requested here
        726 |     fromContainer<Char, std::basic_string<Char>>();
            |     ^
      /home/moheim/qt/qt6/qtbase/tests/auto/corelib/text/qbytearrayview/tst_qbytearrayview.cpp:212:9: note: in instantiationof function template specialization 'tst_QByteArrayView::fromContainers<signed char>' requested here
        212 |         fromContainers<signed char>();
            |         ^
      /usr/lib/llvm-19/bin/../include/c++/v1/__fwd/string.h:23:29: note: template is declared here
         23 | struct _LIBCPP_TEMPLATE_VIS char_traits;
            |                             ^ 

      This applies to the tests for uchar, signed char, and std::byte:

          void fromUCharContainers() const
          {
              fromContainers<uchar>();
          }
      
          void fromSignedCharContainers() const
          {
              fromContainers<signed char>();
          }
      
          void fromStdByteContainers() const
          {
              fromContainers<std::byte>();
          }
       

      Attachments

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

        Activity

          People

            thiago Thiago Macieira
            moheim Moss Heim
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes