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

compiler error in qdatetime.cpp

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • P3: Somewhat important
    • None
    • 6.2.0 RC
    • Core: Date/Time
    • None
    • Linux/X11

    Description

      When trying to build Qt I'm running into the compiler errors below in qdatetime.cpp. My compiler is:

      gcc (SUSE Linux) 10.2.1 20200825 [revision c0746a1beb1ba073c7981eb09f55b3d993b32e5c]

      As I'm running into other errors with this compiler version it looks like it has never been tested so far. I had the impression, that Qt 6.2 is supposed to work with all >= gcc 9 vesions ?

      /disk3/qt/qt-everywhere-src-6.2.0-rc/qtbase/src/corelib/time/qdatetime.cpp:4015:76: error: no matching function for call to ‘add_overflow(qint64&, long int, qint64*)’
               if (!add_overflow(msecs, d->m_offsetFromUtc * MSECS_PER_SEC, &msecs))
                                                                                  ^
      In file included from /disk3/qt/qt-everywhere-src-6.2.0-rc/qtbase/include/QtCore/6.2.0/QtCore/private/qnumeric_p.h:1:0,
                       from /disk3/qt/qt-everywhere-src-6.2.0-rc/qtbase/src/corelib/time/qdatetime.cpp:58:
      /disk3/qt/qt-everywhere-src-6.2.0-rc/qtbase/include/QtCore/6.2.0/QtCore/private/../../../../../src/corelib/global/qnumeric_p.h:234:35: note: candidate: template<class T> bool {anonymous}::add_overflow(T, T, T*)
       template <typename T> inline bool add_overflow(T v1, T v2, T *r) { return qAddOverflow(v1, v2, r); }
                                         ^~~~~~~~~~~~
      /disk3/qt/qt-everywhere-src-6.2.0-rc/qtbase/include/QtCore/6.2.0/QtCore/private/../../../../../src/corelib/global/qnumeric_p.h:234:35: note:   template argument deduction/substitution failed:
      /disk3/qt/qt-everywhere-src-6.2.0-rc/qtbase/src/corelib/time/qdatetime.cpp:4015:76: note:   deduced conflicting types for parameter ‘T’ (‘long long int’ and ‘long int’)
               if (!add_overflow(msecs, d->m_offsetFromUtc * MSECS_PER_SEC, &msecs))
                                                                                  ^
      In file included from /disk3/qt/qt-everywhere-src-6.2.0-rc/qtbase/include/QtCore/6.2.0/QtCore/private/qnumeric_p.h:1:0,
                       from /disk3/qt/qt-everywhere-src-6.2.0-rc/qtbase/src/corelib/time/qdatetime.cpp:58:
      /disk3/qt/qt-everywhere-src-6.2.0-rc/qtbase/include/QtCore/6.2.0/QtCore/private/../../../../../src/corelib/global/qnumeric_p.h:238:34: note: candidate: template<class T, T V2> bool {anonymous}::add_overflow(T, std::integral_constant<T, V2>, T*)
       template <typename T, T V2> bool add_overflow(T v1, std::integral_constant<T, V2>, T *r)
                                        ^~~~~~~~~~~~
      /disk3/qt/qt-everywhere-src-6.2.0-rc/qtbase/include/QtCore/6.2.0/QtCore/private/../../../../../src/corelib/global/qnumeric_p.h:238:34: note:   template argument deduction/substitution failed:
      /disk3/qt/qt-everywhere-src-6.2.0-rc/qtbase/src/corelib/time/qdatetime.cpp:4015:76: note:   mismatched types ‘std::integral_constant<T, V2>’ and ‘long int’
               if (!add_overflow(msecs, d->m_offsetFromUtc * MSECS_PER_SEC, &msecs))
                                                                                  ^
      In file included from /disk3/qt/qt-everywhere-src-6.2.0-rc/qtbase/include/QtCore/6.2.0/QtCore/private/qnumeric_p.h:1:0,
                       from /disk3/qt/qt-everywhere-src-6.2.0-rc/qtbase/src/corelib/time/qdatetime.cpp:58:
      /disk3/qt/qt-everywhere-src-6.2.0-rc/qtbase/include/QtCore/6.2.0/QtCore/private/../../../../../src/corelib/global/qnumeric_p.h:243:37: note: candidate: template<auto V2, class T> bool {anonymous}::add_overflow(T, T*)
       template <auto V2, typename T> bool add_overflow(T v1, T *r)
                                           ^~~~~~~~~~~~
      /disk3/qt/qt-everywhere-src-6.2.0-rc/qtbase/include/QtCore/6.2.0/QtCore/private/../../../../../src/corelib/global/qnumeric_p.h:243:37: note:   template argument deduction/substitution failed:
      /disk3/qt/qt-everywhere-src-6.2.0-rc/qtbase/src/corelib/time/qdatetime.cpp:4015:76: note:   mismatched types ‘T*’ and ‘long int’
               if (!add_overflow(msecs, d->m_offsetFromUtc * MSECS_PER_SEC, &msecs))
      

      Attachments

        Issue Links

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

          Activity

            People

              Eddy Edward Welbourne
              uwe Uwe Rathmann
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes