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

qdatetime.cpp in 6.2.0-beta1 does not compile with gcc 10.2.1

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Not Evaluated
    • Resolution: Fixed
    • Affects Version/s: 6.2.0 Beta1
    • Fix Version/s: 6.2.0 Beta2
    • Component/s: Core: Date/Time
    • Labels:
      None
    • Platform/s:
      Linux/X11
    • Commits:
      4059af81d33bb1f6a7773b77d3039f2fc53fcd23

      Description

      When trying to build Qt 6.2.0 Beta1 I'm running into compiler errors
      ( gcc (SUSE Linux) 10.2.1 20200825 [revision c0746a1beb1ba073c7981eb09f55b3d993b32e5c] ):

      /disk3/qt/qt-everywhere-src-6.2.0-beta1/qtbase/src/corelib/time/qdatetime.cpp: In member function 'void QDateTime::setMSecsSinceEpoch(qint64)':
      /disk3/qt/qt-everywhere-src-6.2.0-beta1/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-beta1/qtbase/include/QtCore/6.2.0/QtCore/private/qnumeric_p.h:1:0,
      from /disk3/qt/qt-everywhere-src-6.2.0-beta1/qtbase/src/corelib/time/qdatetime.cpp:58:
      /disk3/qt/qt-everywhere-src-6.2.0-beta1/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-beta1/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-beta1/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-beta1/qtbase/include/QtCore/6.2.0/QtCore/private/qnumeric_p.h:1:0,
      from /disk3/qt/qt-everywhere-src-6.2.0-beta1/qtbase/src/corelib/time/qdatetime.cpp:58:
      /disk3/qt/qt-everywhere-src-6.2.0-beta1/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-beta1/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-beta1/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-beta1/qtbase/include/QtCore/6.2.0/QtCore/private/qnumeric_p.h:1:0,
      from /disk3/qt/qt-everywhere-src-6.2.0-beta1/qtbase/src/corelib/time/qdatetime.cpp:58:
      /disk3/qt/qt-everywhere-src-6.2.0-beta1/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-beta1/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-beta1/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))
      ^
      make[2]: *** [qtbase/src/tools/bootstrap/CMakeFiles/Bootstrap.dir/build.make:1056: qtbase/src/tools/bootstrap/CMakeFiles/Bootstrap.dir/__/__/corelib/time/qdatetime.cpp.o] Error 1
      make[1]: *** [CMakeFiles/Makefile2:6204: qtbase/src/tools/bootstrap/CMakeFiles/Bootstrap.dir/all] Error 2

        Attachments

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

          Activity

            People

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

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes