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

tst_QCborStreamWriter float16 QVariant conversion doesn't build

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Not Evaluated
    • None
    • 6.6, dev
    • Core: I/O
    • None

    Description

      This has been going on for a few weeks for me; I figured maybe a fix would show up, and nobody else seems to be complaining, so I wonder if it's some system library/header that my Qt build is pulling in, or something.

      [4/16] Building CXX object qtbase/tests/auto/corelib/serialization/qcborstreamwriter/CMakeFiles/tst_qcborstreamwriter.dir/tst_qcborstreamwriter.cpp.o
      FAILED: qtbase/tests/auto/corelib/serialization/qcborstreamwriter/CMakeFiles/tst_qcborstreamwriter.dir/tst_qcborstreamwriter.cpp.o 
      /usr/lib/ccache/bin/c++ -DQT_CORE_LIB -DQT_DISABLE_DEPRECATED_UP_TO=0x050000 -DQT_EXPLICIT_QFILE_CONSTRUCTION_FROM_PATH -DQT_LEAN_HEADERS=1 -DQT_NO_AS_CONST -DQT_NO_JAVA_STYLE_ITERATORS -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DQT_NO_QEXCHANGE -DQT_STRICT_QLIST_ITERATORS -DQT_TESTCASE_BUILDDIR=\"/home/rutledge/dev/qt6-dbg/qtbase/tests/auto/corelib/serialization/qcborstreamwriter\" -DQT_TESTCASE_SOURCEDIR=\"/home/rutledge/dev/qt6/qtbase/tests/auto/corelib/serialization/qcborstreamwriter\" -DQT_TESTLIB_LIB -DQT_WARN_DEPRECATED_UP_TO=0x070000 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -I/home/rutledge/dev/qt6-dbg/qtbase/tests/auto/corelib/serialization/qcborstreamwriter/tst_qcborstreamwriter_autogen/include -I/home/rutledge/dev/qt6/qtbase/tests/auto/corelib/serialization/qcborstreamwriter -I/home/rutledge/dev/qt6-dbg/qtbase/tests/auto/corelib/serialization/qcborstreamwriter -I/home/rutledge/dev/qt6-dbg/qtbase/include -I/home/rutledge/dev/qt6/qtbase/tests/auto/corelib/serialization/qcborstreamwriter/../../../../../src/3rdparty/tinycbor/tests/encoder -I/home/rutledge/dev/qt6-dbg/qtbase/include/QtCore -I/home/rutledge/dev/qt6-dbg/qtbase/mkspecs/linux-g++ -I/home/rutledge/dev/qt6-dbg/qtbase/include/QtTest -g -std=gnu++17 -fPIE -fvisibility=hidden -fvisibility-inlines-hidden -Wall -Wextra -fPIC -Wsuggest-override -MD -MT qtbase/tests/auto/corelib/serialization/qcborstreamwriter/CMakeFiles/tst_qcborstreamwriter.dir/tst_qcborstreamwriter.cpp.o -MF qtbase/tests/auto/corelib/serialization/qcborstreamwriter/CMakeFiles/tst_qcborstreamwriter.dir/tst_qcborstreamwriter.cpp.o.d -o qtbase/tests/auto/corelib/serialization/qcborstreamwriter/CMakeFiles/tst_qcborstreamwriter.dir/tst_qcborstreamwriter.cpp.o -c /home/rutledge/dev/qt6/qtbase/tests/auto/corelib/serialization/qcborstreamwriter/tst_qcborstreamwriter.cpp
      In file included from /home/rutledge/dev/qt6/qtbase/tests/auto/corelib/serialization/qcborstreamwriter/tst_qcborstreamwriter.cpp:32:
      /home/rutledge/dev/qt6/qtbase/tests/auto/corelib/serialization/qcborstreamwriter/../../../../../src/3rdparty/tinycbor/tests/encoder/data.cpp: In function ‘void addFixedData()’:
      /home/rutledge/dev/qt6/qtbase/tests/auto/corelib/serialization/qcborstreamwriter/../../../../../src/3rdparty/tinycbor/tests/encoder/data.cpp:242:83: error: no matching function for call to ‘QVariant::fromValue<qfloat16>(float)’
        242 |     QTest::newRow("nan_f16") << raw("\xf9\x7e\0") << QVariant::fromValue<qfloat16>(myNaNf());
            |                                                      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
      In file included from /home/rutledge/dev/qt6-dbg/qtbase/include/QtCore/qvariant.h:1,
                       from /home/rutledge/dev/qt6-dbg/qtbase/include/QtCore/../../../../qt6/qtbase/src/corelib/kernel/qmetaobject.h:9,
                       from /home/rutledge/dev/qt6-dbg/qtbase/include/QtCore/qmetaobject.h:1,
                       from /home/rutledge/dev/qt6-dbg/qtbase/include/QtTest/../../../../qt6/qtbase/src/testlib/qtestcase.h:12,
                       from /home/rutledge/dev/qt6-dbg/qtbase/include/QtTest/qtestcase.h:1,
                       from /home/rutledge/dev/qt6-dbg/qtbase/include/QtTest/../../../../qt6/qtbase/src/testlib/qtest.h:13,
                       from /home/rutledge/dev/qt6-dbg/qtbase/include/QtTest/qtest.h:1,
                       from /home/rutledge/dev/qt6-dbg/qtbase/include/QtTest/QTest:1,
                       from /home/rutledge/dev/qt6/qtbase/tests/auto/corelib/serialization/qcborstreamwriter/tst_qcborstreamwriter.cpp:4:
      /home/rutledge/dev/qt6-dbg/qtbase/include/QtCore/../../../../qt6/qtbase/src/corelib/kernel/qvariant.h:531:24: note: candidate: ‘template<class T, typename std::enable_if<(! is_reference_v<T>), bool>::type <anonymous> > static std::enable_if_t<conjunction_v<std::is_copy_constructible<_Tp>, std::is_destructible<T> >, QVariant> QVariant::fromValue(T&&)’
        531 |     static inline auto fromValue(T &&value)
            |                        ^~~~~~~~~
      /home/rutledge/dev/qt6-dbg/qtbase/include/QtCore/../../../../qt6/qtbase/src/corelib/kernel/qvariant.h:531:24: note:   template argument deduction/substitution failed:
      /home/rutledge/dev/qt6/qtbase/tests/auto/corelib/serialization/qcborstreamwriter/../../../../../src/3rdparty/tinycbor/tests/encoder/data.cpp:242:90: note:   cannot convert ‘myNaNf()’ (type ‘float’) to type ‘qfloat16&&’
        242 |     QTest::newRow("nan_f16") << raw("\xf9\x7e\0") << QVariant::fromValue<qfloat16>(myNaNf());
            |                                                                                    ~~~~~~^~
      /home/rutledge/dev/qt6-dbg/qtbase/include/QtCore/../../../../qt6/qtbase/src/corelib/kernel/qvariant.h:561:24: note: candidate: ‘static std::enable_if_t<(is_copy_constructible_v<T> && is_destructible_v<T>), QVariant> QVariant::fromValue(const T&) [with T = qfloat16; std::enable_if_t<(is_copy_constructible_v<T> && is_destructible_v<T>), QVariant> = QVariant]’ (near match)
        561 |     static inline auto fromValue(const T &value)
            |                        ^~~~~~~~~
      /home/rutledge/dev/qt6-dbg/qtbase/include/QtCore/../../../../qt6/qtbase/src/corelib/kernel/qvariant.h:561:24: note:   conversion of argument 1 would be ill-formed:
      /home/rutledge/dev/qt6/qtbase/tests/auto/corelib/serialization/qcborstreamwriter/../../../../../src/3rdparty/tinycbor/tests/encoder/data.cpp:242:90: error: invalid user-defined conversion from ‘float’ to ‘const qfloat16&’ [-fpermissive]
        242 |     QTest::newRow("nan_f16") << raw("\xf9\x7e\0") << QVariant::fromValue<qfloat16>(myNaNf());
            |                                                                                    ~~~~~~^~
      In file included from /home/rutledge/dev/qt6-dbg/qtbase/include/QtCore/qfloat16.h:1,
                       from /home/rutledge/dev/qt6-dbg/qtbase/include/QtCore/../../../../qt6/qtbase/src/corelib/kernel/qmetatype.h:14,
                       from /home/rutledge/dev/qt6-dbg/qtbase/include/QtCore/qmetatype.h:1,
                       from /home/rutledge/dev/qt6-dbg/qtbase/include/QtTest/../../../../qt6/qtbase/src/testlib/qtestcase.h:11:
      /home/rutledge/dev/qt6-dbg/qtbase/include/QtCore/../../../../qt6/qtbase/src/corelib/global/qfloat16.h:81:22: note: candidate is: ‘constexpr qfloat16::qfloat16(NativeType)’ (near match)
         81 |     constexpr inline qfloat16(NativeType f) : nf(f) {}
            |                      ^~~~~~~~
      /home/rutledge/dev/qt6-dbg/qtbase/include/QtCore/../../../../qt6/qtbase/src/corelib/global/qfloat16.h:81:22: note:   conversion of argument 1 would be ill-formed:
      /home/rutledge/dev/qt6/qtbase/tests/auto/corelib/serialization/qcborstreamwriter/../../../../../src/3rdparty/tinycbor/tests/encoder/data.cpp:242:90: warning: converting to ‘qfloat16::NativeType’ {aka ‘_Float16’} from ‘float’ with greater conversion rank
        242 |     QTest::newRow("nan_f16") << raw("\xf9\x7e\0") << QVariant::fromValue<qfloat16>(myNaNf());
            |                                                                                    ~~~~~~^~
      /home/rutledge/dev/qt6/qtbase/tests/auto/corelib/serialization/qcborstreamwriter/../../../../../src/3rdparty/tinycbor/tests/encoder/data.cpp:242:90: warning: converting to ‘qfloat16::NativeType’ {aka ‘_Float16’} from ‘float’ with greater conversion rank
      /home/rutledge/dev/qt6-dbg/qtbase/include/QtCore/../../../../qt6/qtbase/src/corelib/global/qfloat16.h:81:42: note:   initializing argument 1 of ‘constexpr qfloat16::qfloat16(NativeType)’
         81 |     constexpr inline qfloat16(NativeType f) : nf(f) {}
            |                               ~~~~~~~~~~~^
      /home/rutledge/dev/qt6/qtbase/tests/auto/corelib/serialization/qcborstreamwriter/../../../../../src/3rdparty/tinycbor/tests/encoder/data.cpp:243:84: error: no matching function for call to ‘QVariant::fromValue<qfloat16>(float)’
        243 |     QTest::newRow("-inf_f16") << raw("\xf9\xfc\0") << QVariant::fromValue<qfloat16>(myNInff());
            |                                                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~
      /home/rutledge/dev/qt6-dbg/qtbase/include/QtCore/../../../../qt6/qtbase/src/corelib/kernel/qvariant.h:531:24: note: candidate: ‘template<class T, typename std::enable_if<(! is_reference_v<T>), bool>::type <anonymous> > static std::enable_if_t<conjunction_v<std::is_copy_constructible<_Tp>, std::is_destructible<T> >, QVariant> QVariant::fromValue(T&&)’
        531 |     static inline auto fromValue(T &&value)
            |                        ^~~~~~~~~
      /home/rutledge/dev/qt6-dbg/qtbase/include/QtCore/../../../../qt6/qtbase/src/corelib/kernel/qvariant.h:531:24: note:   template argument deduction/substitution failed:
      /home/rutledge/dev/qt6/qtbase/tests/auto/corelib/serialization/qcborstreamwriter/../../../../../src/3rdparty/tinycbor/tests/encoder/data.cpp:243:92: note:   cannot convert ‘myNInff()’ (type ‘float’) to type ‘qfloat16&&’
        243 |     QTest::newRow("-inf_f16") << raw("\xf9\xfc\0") << QVariant::fromValue<qfloat16>(myNInff());
            |                                                                                     ~~~~~~~^~
      /home/rutledge/dev/qt6-dbg/qtbase/include/QtCore/../../../../qt6/qtbase/src/corelib/kernel/qvariant.h:561:24: note: candidate: ‘static std::enable_if_t<(is_copy_constructible_v<T> && is_destructible_v<T>), QVariant> QVariant::fromValue(const T&) [with T = qfloat16; std::enable_if_t<(is_copy_constructible_v<T> && is_destructible_v<T>), QVariant> = QVariant]’ (near match)
        561 |     static inline auto fromValue(const T &value)
            |                        ^~~~~~~~~
      /home/rutledge/dev/qt6-dbg/qtbase/include/QtCore/../../../../qt6/qtbase/src/corelib/kernel/qvariant.h:561:24: note:   conversion of argument 1 would be ill-formed:
      /home/rutledge/dev/qt6/qtbase/tests/auto/corelib/serialization/qcborstreamwriter/../../../../../src/3rdparty/tinycbor/tests/encoder/data.cpp:243:92: error: invalid user-defined conversion from ‘float’ to ‘const qfloat16&’ [-fpermissive]
        243 |     QTest::newRow("-inf_f16") << raw("\xf9\xfc\0") << QVariant::fromValue<qfloat16>(myNInff());
            |                                                                                     ~~~~~~~^~
      /home/rutledge/dev/qt6-dbg/qtbase/include/QtCore/../../../../qt6/qtbase/src/corelib/global/qfloat16.h:81:22: note: candidate is: ‘constexpr qfloat16::qfloat16(NativeType)’ (near match)
         81 |     constexpr inline qfloat16(NativeType f) : nf(f) {}
            |                      ^~~~~~~~
      /home/rutledge/dev/qt6-dbg/qtbase/include/QtCore/../../../../qt6/qtbase/src/corelib/global/qfloat16.h:81:22: note:   conversion of argument 1 would be ill-formed:
      /home/rutledge/dev/qt6/qtbase/tests/auto/corelib/serialization/qcborstreamwriter/../../../../../src/3rdparty/tinycbor/tests/encoder/data.cpp:243:92: warning: converting to ‘qfloat16::NativeType’ {aka ‘_Float16’} from ‘float’ with greater conversion rank
        243 |     QTest::newRow("-inf_f16") << raw("\xf9\xfc\0") << QVariant::fromValue<qfloat16>(myNInff());
            |                                                                                     ~~~~~~~^~
      /home/rutledge/dev/qt6/qtbase/tests/auto/corelib/serialization/qcborstreamwriter/../../../../../src/3rdparty/tinycbor/tests/encoder/data.cpp:243:92: warning: converting to ‘qfloat16::NativeType’ {aka ‘_Float16’} from ‘float’ with greater conversion rank
      /home/rutledge/dev/qt6-dbg/qtbase/include/QtCore/../../../../qt6/qtbase/src/corelib/global/qfloat16.h:81:42: note:   initializing argument 1 of ‘constexpr qfloat16::qfloat16(NativeType)’
         81 |     constexpr inline qfloat16(NativeType f) : nf(f) {}
            |                               ~~~~~~~~~~~^
      /home/rutledge/dev/qt6/qtbase/tests/auto/corelib/serialization/qcborstreamwriter/../../../../../src/3rdparty/tinycbor/tests/encoder/data.cpp:244:84: error: no matching function for call to ‘QVariant::fromValue<qfloat16>(float)’
        244 |     QTest::newRow("+inf_f16") << raw("\xf9\x7c\0") << QVariant::fromValue<qfloat16>(myInff());
            |                                                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~
      /home/rutledge/dev/qt6-dbg/qtbase/include/QtCore/../../../../qt6/qtbase/src/corelib/kernel/qvariant.h:531:24: note: candidate: ‘template<class T, typename std::enable_if<(! is_reference_v<T>), bool>::type <anonymous> > static std::enable_if_t<conjunction_v<std::is_copy_constructible<_Tp>, std::is_destructible<T> >, QVariant> QVariant::fromValue(T&&)’
        531 |     static inline auto fromValue(T &&value)
            |                        ^~~~~~~~~
      /home/rutledge/dev/qt6-dbg/qtbase/include/QtCore/../../../../qt6/qtbase/src/corelib/kernel/qvariant.h:531:24: note:   template argument deduction/substitution failed:
      /home/rutledge/dev/qt6/qtbase/tests/auto/corelib/serialization/qcborstreamwriter/../../../../../src/3rdparty/tinycbor/tests/encoder/data.cpp:244:91: note:   cannot convert ‘myInff()’ (type ‘float’) to type ‘qfloat16&&’
        244 |     QTest::newRow("+inf_f16") << raw("\xf9\x7c\0") << QVariant::fromValue<qfloat16>(myInff());
            |                                                                                     ~~~~~~^~
      /home/rutledge/dev/qt6-dbg/qtbase/include/QtCore/../../../../qt6/qtbase/src/corelib/kernel/qvariant.h:561:24: note: candidate: ‘static std::enable_if_t<(is_copy_constructible_v<T> && is_destructible_v<T>), QVariant> QVariant::fromValue(const T&) [with T = qfloat16; std::enable_if_t<(is_copy_constructible_v<T> && is_destructible_v<T>), QVariant> = QVariant]’ (near match)
        561 |     static inline auto fromValue(const T &value)
            |                        ^~~~~~~~~
      /home/rutledge/dev/qt6-dbg/qtbase/include/QtCore/../../../../qt6/qtbase/src/corelib/kernel/qvariant.h:561:24: note:   conversion of argument 1 would be ill-formed:
      /home/rutledge/dev/qt6/qtbase/tests/auto/corelib/serialization/qcborstreamwriter/../../../../../src/3rdparty/tinycbor/tests/encoder/data.cpp:244:91: error: invalid user-defined conversion from ‘float’ to ‘const qfloat16&’ [-fpermissive]
        244 |     QTest::newRow("+inf_f16") << raw("\xf9\x7c\0") << QVariant::fromValue<qfloat16>(myInff());
            |                                                                                     ~~~~~~^~
      /home/rutledge/dev/qt6-dbg/qtbase/include/QtCore/../../../../qt6/qtbase/src/corelib/global/qfloat16.h:81:22: note: candidate is: ‘constexpr qfloat16::qfloat16(NativeType)’ (near match)
         81 |     constexpr inline qfloat16(NativeType f) : nf(f) {}
            |                      ^~~~~~~~
      /home/rutledge/dev/qt6-dbg/qtbase/include/QtCore/../../../../qt6/qtbase/src/corelib/global/qfloat16.h:81:22: note:   conversion of argument 1 would be ill-formed:
      /home/rutledge/dev/qt6/qtbase/tests/auto/corelib/serialization/qcborstreamwriter/../../../../../src/3rdparty/tinycbor/tests/encoder/data.cpp:244:91: warning: converting to ‘qfloat16::NativeType’ {aka ‘_Float16’} from ‘float’ with greater conversion rank
        244 |     QTest::newRow("+inf_f16") << raw("\xf9\x7c\0") << QVariant::fromValue<qfloat16>(myInff());
            |                                                                                     ~~~~~~^~
      /home/rutledge/dev/qt6/qtbase/tests/auto/corelib/serialization/qcborstreamwriter/../../../../../src/3rdparty/tinycbor/tests/encoder/data.cpp:244:91: warning: converting to ‘qfloat16::NativeType’ {aka ‘_Float16’} from ‘float’ with greater conversion rank
      /home/rutledge/dev/qt6-dbg/qtbase/include/QtCore/../../../../qt6/qtbase/src/corelib/global/qfloat16.h:81:42: note:   initializing argument 1 of ‘constexpr qfloat16::qfloat16(NativeType)’
         81 |     constexpr inline qfloat16(NativeType f) : nf(f) {}
            |                               ~~~~~~~~~~~^
      

      Тhe offending code is in data.cpp (last 3 lines of this):

          QTest::newRow("0.f16") << raw("\xf9\0\0") << QVariant::fromValue(qfloat16(0));
          QTest::newRow("-1.f16") << raw("\xf9\xbc\0") << QVariant::fromValue(qfloat16(-1));
          QTest::newRow("1.5f16") << raw("\xf9\x3e\0") << QVariant::fromValue(qfloat16(1.5));
          QTest::newRow("nan_f16") << raw("\xf9\x7e\0") << QVariant::fromValue<qfloat16>(myNaNf());
          QTest::newRow("-inf_f16") << raw("\xf9\xfc\0") << QVariant::fromValue<qfloat16>(myNInff());
          QTest::newRow("+inf_f16") << raw("\xf9\x7c\0") << QVariant::fromValue<qfloat16>(myInff());
      

      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
              srutledg Shawn Rutledge
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes