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

QT5 source code incompatibility with C++20

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.13.0 Alpha 1
    • 5.13
    • None
    • QT5 dev branch + VS2017 latest version + windows server 2016
    • Windows
    • 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

        Activity

          People

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

            Dates

              Created:
              Updated:
              Resolved: