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

error: ambiguous overload for ‘operator+’

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P0: Blocker
    • None
    • 6.9.0 FF
    • OpcUA
    • None
    • f7a9ce3c1 (dev), 81b3de29b (dev), b7e13a82a (dev), 07a0ecf81 (dev)

    Description

      FAILED: examples/opcua/opcuaviewer/CMakeFiles/opcuaviewer.dir/treeitem.cpp.o 
      sccache /usr/bin/g++ -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NAMESPACE=TestNamespace -DQT_NETWORK_LIB -DQT_OPCUA_LIB -DQT_WIDGETS_LIB -I/home/qt/work/qt/qtopcua_build/examples/opcua/opcuaviewer/opcuaviewer_autogen/include -I/home/qt/work/qt/qtopcua_build/include -I/home/qt/work/qt/qtopcua_build/include/QtOpcUa -isystem /home/qt/work/install/include/QtCore -isystem /home/qt/work/install/include -isystem /home/qt/work/install/mkspecs/linux-g++ -isystem /home/qt/work/install/include/QtGui -isystem /home/qt/work/install/include/QtNetwork -isystem /home/qt/work/install/include/QtWidgets -g -std=gnu++20 -fPIE -Wall -Wextra -fPIC -MD -MT examples/opcua/opcuaviewer/CMakeFiles/opcuaviewer.dir/treeitem.cpp.o -MF examples/opcua/opcuaviewer/CMakeFiles/opcuaviewer.dir/treeitem.cpp.o.d -o examples/opcua/opcuaviewer/CMakeFiles/opcuaviewer.dir/treeitem.cpp.o -c /home/qt/work/qt/qtopcua/examples/opcua/opcuaviewer/treeitem.cpp
      /home/qt/work/qt/qtopcua/examples/opcua/opcuaviewer/treeitem.cpp: In member function ‘TestNamespace::QString TreeItem::variantToString(const TestNamespace::QVariant&, const TestNamespace::QString&) const’:
      /home/qt/work/qt/qtopcua/examples/opcua/opcuaviewer/treeitem.cpp:303:24: error: ambiguous overload for ‘operator+’ (operand types are ‘TestNamespace::QLatin1StringView’ {aka ‘TestNamespace::QLatin1String’} and ‘TestNamespace::QByteArray’)
        303 |         return "0x"_L1 + value.toByteArray().toHex();
            |                ~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
            |                |                                  |
            |                |                                  TestNamespace::QByteArray
            |                TestNamespace::QLatin1StringView {aka TestNamespace::QLatin1String}
      In file included from /home/qt/work/install/include/QtCore/qstringview.h:9,
                       from /home/qt/work/install/include/QtCore/qchar.h:660,
                       from /home/qt/work/install/include/QtCore/qtextstream.h:8,
                       from /home/qt/work/install/include/QtCore/qdebug.h:14,
                       from /home/qt/work/install/include/QtCore/qloggingcategory.h:8,
                       from /home/qt/work/qt/qtopcua/src/opcua/qopcuaglobal.h:8,
                       from /home/qt/work/qt/qtopcua_build/include/QtOpcUa/qopcuaglobal.h:1,
                       from /home/qt/work/qt/qtopcua/src/opcua/client/qopcuatype.h:7,
                       from /home/qt/work/qt/qtopcua_build/include/QtOpcUa/qopcuatype.h:1,
                       from /home/qt/work/qt/qtopcua/examples/opcua/opcuaviewer/treeitem.h:7,
                       from /home/qt/work/qt/qtopcua/examples/opcua/opcuaviewer/treeitem.cpp:4:
      /home/qt/work/install/include/QtCore/qbytearray.h:692:19: note: candidate: ‘TestNamespace::QByteArray TestNamespace::operator+(QByteArrayView, const QByteArray&)’
        692 | inline QByteArray operator+(QByteArrayView lhs, const QByteArray &rhs)
            |                   ^~~~~~~~
      In file included from /home/qt/work/install/include/QtCore/qdebug.h:17:
      /home/qt/work/install/include/QtCore/qstring.h:1423:16: note: candidate: ‘TestNamespace::QString TestNamespace::operator+(const QString&, const QString&)’
       1423 | inline QString operator+(const QString &s1, const QString &s2)
            |                ^~~~~~~~
      /home/qt/work/install/include/QtCore/qstring.h:1425:16: note: candidate: ‘TestNamespace::QString TestNamespace::operator+(QString&&, const QString&)’
       1425 | inline QString operator+(QString &&lhs, const QString &rhs)
            |                ^~~~~~~~
      /home/qt/work/install/include/QtCore/qstring.h:1445:35: note: candidate: ‘TestNamespace::QString TestNamespace::operator+(const QString&, const char*)’
       1445 | QT_ASCII_CAST_WARN inline QString operator+(const QString &s1, const char *s2)
            |                                   ^~~~~~~~
      /home/qt/work/install/include/QtCore/qstring.h:1447:35: note: candidate: ‘TestNamespace::QString TestNamespace::operator+(QString&&, const char*)’
       1447 | QT_ASCII_CAST_WARN inline QString operator+(QString &&lhs, const char *rhs)
            |                                   ^~~~~~~~
      /home/qt/work/install/include/QtCore/qstring.h:1453:35: note: candidate: ‘TestNamespace::QString TestNamespace::operator+(const QString&, const QByteArray&)’
       1453 | QT_ASCII_CAST_WARN inline QString operator+(const QString &s, const QByteArray &ba)
            |                                   ^~~~~~~~
      /home/qt/work/install/include/QtCore/qstring.h:1455:35: note: candidate: ‘TestNamespace::QString TestNamespace::operator+(QString&&, const QByteArray&)’
       1455 | QT_ASCII_CAST_WARN inline QString operator+(QString &&lhs, const QByteArray &rhs)
      

      Build log: https://testresults.qt.io/logs/qt/qtopcua/7c7ee49a5c8ebc03a57422e8c0e24ad114b23c61/LinuxUbuntu_24_04x86_64LinuxUbuntu_24_04x86_64GCCqtci-linux-Ubuntu-24.04-x86_64-50-42b5d3Documentation_Sccache_UseConfigure/d871a8017acaaca654097e41650a352c8e0024c7/build_1723213025/log.txt.gz

      Details: https://testresults.qt.io/coin/integration/qt/qtopcua/tasks/1723213013

      Tested changes (refs/builds/qtci/dev/1723212786):
      https://codereview.qt-project.org/c/qt/qtopcua/+/582198/2 Update dependencies on 'dev' in qt/qtopcua

      Attachments

        Issue Links

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

          Activity

            People

              basyskom.jannis.voelker Jannis Völker
              janihe Jani Heikkinen
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes