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

QT5 source code incompatibility with C++20

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: 5.13
    • Fix Version/s: 5.13.0 Alpha 1
    • Labels:
      None
    • Environment:
      QT5 dev branch + VS2017 latest version + windows server 2016
    • Platform/s:
      Windows
    • Commits:
      b337d2a88e5dba8b1e4c01ebe60a7cddc76d05d3 (qt/qtbase/wip/qt6)

      Description

      A paper(see attachment p1008r1.pdf) voted into the C++20 working draft changes the definition of aggregate such that classes with any user-declared ctors are no longer aggregates.

      The MSVC team builds QT5 regularly to detect regressions, and found this failure under our build configuration with the -std:c++latest switch. We are using the following backwards-compatible patch(see attachment qt5_latest_c2127.patch) going forward, which you are free to upstream it if C+20 compatibility is on the library's radar.

      You can reproduce this issue on the next released MSVC.

      Failures:

       D:\QT5\src\qtbase\src\dbus\qdbuserror.cpp(56): error C2127: 'errorMessages': illegal initialization of 'constexpr' entity with a non-constant expression
       D:\QT5\src\qtbase\include\QtCore\5.13.0\QtCore\private\../../../../../src/corelib/tools/qoffsetstringarray_p.h(187): note: failure was because type 'QOffsetStringArray<unsigned short,1055,29>' is not a literal type
       D:\QT5\src\qtbase\include\QtCore\5.13.0\QtCore\private\../../../../../src/corelib/tools/qoffsetstringarray_p.h(169): note: type 'QOffsetStringArray<unsigned short,1055,29>' is not a literal type because its data member 'm_string' is of non-literal type 'QtPrivate::StaticString<1055>'
       D:\QT5\src\qtbase\include\QtCore\5.13.0\QtCore\private\../../../../../src/corelib/tools/qoffsetstringarray_p.h(145): note: type 'QtPrivate::StaticString<1055>' is not a literal type because it is not an aggregate type, a closure type, or does not have a constexpr constructor that is not a copy or move constructor
      

        Attachments

        1. p1008r1.pdf
          246 kB
        2. qt5_latest_c2127.patch
          0.4 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            thiago Thiago Macieira
            Reporter:
            quellazhang Quella Zhang
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes