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

[Reg: 6.3 -> 6.4] C3615: constexpr function 'QtPrivate::QMetaTypeForType<T>::getName' cannot result in a constant expression

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • 6.4.0
    • 6.4.0 Beta4, 6.4.0 RC1
    • Build tools: moc
    • None
    • All
    • a8ccd9cd84 (qt/qtbase/dev) a8ccd9cd84 (qt/tqtc-qtbase/dev) bd14c12e28 (qt/qtbase/6.4) bc7e633855 (qt/qtbase/6.4.0) bd14c12e28 (qt/tqtc-qtbase/6.4) bc7e633855 (qt/tqtc-qtbase/6.4.0)

    Description

      This bug appeard in Qt 6.4 beta 4 (or maybe 3). It works with all previous Qt versions. Tested with latest MSVC 2022 x64

      Created moc:

      moc_util.cpp

       

      QArchive is used as Q_PROPERTY member to make it callable in qml.

      https://gitlab.com/kelteseth/ScreenPlay/-/blob/master/ScreenPlay/inc/public/ScreenPlay/util.h#L86

       

      [469/519 12.1/sec] Building CXX object ScreenPlay\CMakeFiles\ScreenPlayApp.dir\ScreenPlayApp_autogen\mocs_compilation.cpp.obj
      FAILED: ScreenPlay/CMakeFiles/ScreenPlayApp.dir/ScreenPlayApp_autogen/mocs_compilation.cpp.obj 
      C:\PROGRA~1\MICROS~3\2022\COMMUN~1\VC\Tools\MSVC\1433~1.316\bin\HostX64\x64\cl.exe  /nologo /TP -DBUILD_DATE=\"16/09/2022\" -DBUILD_TYPE=\"RelWithDebInfo\" -DCOMPILE_INFO="\"Build Date: . Git Hash: . \"" -DGIT_BRANCH_NAME=\"master\" -DGIT_COMMIT_HASH=\"3fc123ef\" -DQT_CORE_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_QMLINTEGRATION_LIB -DQT_QMLMODELS_LIB -DQT_QML_LIB -DQT_QUICKCONTROLS2_LIB -DQT_QUICK_LIB -DQT_SVG_LIB -DQT_WEBSOCKETS_LIB -DQT_WIDGETS_LIB -DSCREENPLAY_STEAM -DSOURCE_DIR=\"C:/Code/cpp/ScreenPlay/ScreenPlay\" -DUNICODE -DWIN32 -DWIN64 -D_ENABLE_EXTENDED_ALIGNED_STORAGE -D_UNICODE -D_WIN64 -IC:\Code\cpp\ScreenPlay\build-ScreenPlay-SP_Qt_6_4_0_MSVC2019_64bit-RelWithDebInfo\ScreenPlay\ScreenPlayApp_autogen\include -IC:\Code\cpp\ScreenPlay\ScreenPlay\ScreenPlay\src -IC:\Code\cpp\ScreenPlay\ScreenPlay\ScreenPlay\inc\public\ScreenPlay -IC:\Code\cpp\ScreenPlay\ScreenPlay\ScreenPlay -IC:\Qt\6.4.0\msvc2019_64\include\QtQml\6.4.0 -IC:\Qt\6.4.0\msvc2019_64\include\QtQml\6.4.0\QtQml -IC:\Qt\6.4.0\msvc2019_64\include\QtCore\6.4.0 -IC:\Qt\6.4.0\msvc2019_64\include\QtCore\6.4.0\QtCore -IC:\Code\cpp\ScreenPlay\ScreenPlay\ScreenPlay\inc\public -IC:\Code\cpp\ScreenPlay\ScreenPlay\ScreenPlaySDK\inc\public -IC:\Code\cpp\ScreenPlay\ScreenPlay\ScreenPlayUtil\inc\public -IC:\Code\cpp\ScreenPlay\ScreenPlay\ThirdParty\QArchive -IC:\Code\cpp\ScreenPlay\ScreenPlay\ThirdParty\QArchive\include -IC:\Code\cpp\ScreenPlay\build-ScreenPlay-SP_Qt_6_4_0_MSVC2019_64bit-RelWithDebInfo\ThirdParty\QArchive -IC:\Code\cpp\ScreenPlay\ScreenPlay\ScreenPlayWorkshop\SteamSDK\public -IC:\Code\cpp\ScreenPlay\ScreenPlay\ScreenPlayWorkshop\src -external:IC:\Qt\6.4.0\msvc2019_64\include\QtCore -external:IC:\Qt\6.4.0\msvc2019_64\include -external:IC:\Qt\6.4.0\msvc2019_64\mkspecs\win32-msvc -external:IC:\Qt\6.4.0\msvc2019_64\include\QtQml -external:IC:\Qt\6.4.0\msvc2019_64\include\QtQmlIntegration -external:IC:\Qt\6.4.0\msvc2019_64\include\QtNetwork -external:IC:\Qt\6.4.0\msvc2019_64\include\QtQuick -external:IC:\Qt\6.4.0\msvc2019_64\include\QtGui -external:IC:\Qt\6.4.0\msvc2019_64\include\QtQmlModels -external:IC:\Qt\6.4.0\msvc2019_64\include\QtOpenGL -external:IC:\Qt\6.4.0\msvc2019_64\include\QtWidgets -external:IC:\Qt\6.4.0\msvc2019_64\include\QtWebSockets -external:IC:\Qt\6.4.0\msvc2019_64\include\QtSvg -external:IC:\Qt\6.4.0\msvc2019_64\include\QtQuickControls2 -external:IC:\Code\cpp\ScreenPlay\ScreenPlay-vcpkg\installed\x64-windows\include -external:W0 /DWIN32 /D_WINDOWS /GR /EHsc -DQT_QML_DEBUG /Zi /O2 /Ob1 /DNDEBUG -MD -Zc:__cplusplus -permissive- -utf-8 -std:c++20 /showIncludes /FoScreenPlay\CMakeFiles\ScreenPlayApp.dir\ScreenPlayApp_autogen\mocs_compilation.cpp.obj /FdScreenPlay\CMakeFiles\ScreenPlayApp.dir\ScreenPlayApp.pdb /FS -c C:\Code\cpp\ScreenPlay\build-ScreenPlay-SP_Qt_6_4_0_MSVC2019_64bit-RelWithDebInfo\ScreenPlay\ScreenPlayApp_autogen\mocs_compilation.cpp
      C:\Qt\6.4.0\msvc2019_64\include\QtCore/qmetatype.h(2343): error C2039: 'IsBuiltIn': is not a member of 'QMetaTypeId2<T>'
              with
              [
                  T=Ty
              ]
      C:\Qt\6.4.0\msvc2019_64\include\QtCore/qmetatype.h(1120): note: see declaration of 'QMetaTypeId2<T>'
              with
              [
                  T=Ty
              ]
      C:\Qt\6.4.0\msvc2019_64\include\QtCore/qmetatype.h(2342): note: while compiling class template member function 'const char *QtPrivate::QMetaTypeForType<T>::getName(void)'
              with
              [
                  T=Ty
              ]
      C:\Qt\6.4.0\msvc2019_64\include\QtCore/qmetatype.h(2361): note: see reference to class template instantiation 'QtPrivate::QMetaTypeForType<T>' being compiled
              with
              [
                  T=Ty
              ]
      C:\Qt\6.4.0\msvc2019_64\include\QtCore/qmetatype.h(2461): note: see reference to class template instantiation 'QtPrivate::QMetaTypeInterfaceWrapper<Ty>' being compiled
      C:\Qt\6.4.0\msvc2019_64\include\QtCore/qmetatype.h(2514): note: see reference to function template instantiation 'const QtPrivate::QMetaTypeInterface *QtPrivate::qMetaTypeInterfaceForType<QString&>(void)' being compiled
      C:\Code\cpp\ScreenPlay\build-ScreenPlay-SP_Qt_6_4_0_MSVC2019_64bit-RelWithDebInfo\ScreenPlay\ScreenPlayApp_autogen\T3XL53HUCA/moc_util.cpp(329): note: see reference to variable template 'const QtPrivate::QMetaTypeInterface *const qt_metaTypeArray<QString,QArchive::DiskCompressor *,QArchive::DiskExtractor *,ScreenPlay::Util,void,QString,void,bool,void,void,QString,enum ScreenPlay::InstalledType::InstalledType,void,QString,void,QString,void,QString,void,QArchive::DiskCompressor *,void,QArchive::DiskExtractor *,void,QString const &,void,QString const &,QString,QString const &,bool,QString &,QString &,bool,QString &,QString,void,void,void,enum QtMsgType,QMessageLogContext const &,QString const &,bool,QString const &,QJsonObject const &,bool,bool,QString const &,QJsonObject const &,bool,QJsonObject const &,QString const &,bool,QString const &,QString const &,bool,QString const &,QString const &,bool,QJsonObject &,QString const &,QString const &,void,QString,void,bool,void,void,QString,void,QArchive::DiskCompressor *,void,QArchive::DiskExtractor *>[71]' being compiled
      C:\Qt\6.4.0\msvc2019_64\include\QtCore/qmetatype.h(2343): error C2065: 'IsBuiltIn': undeclared identifier
      C:\Qt\6.4.0\msvc2019_64\include\QtCore/qmetatype.h(2344): error C2039: 'nameAsArray': is not a member of 'QMetaTypeId2<T>'
              with
              [
                  T=Ty
              ]
      C:\Qt\6.4.0\msvc2019_64\include\QtCore/qmetatype.h(1120): note: see declaration of 'QMetaTypeId2<T>'
              with
              [
                  T=Ty
              ]
      C:\Qt\6.4.0\msvc2019_64\include\QtCore/qmetatype.h(2344): error C2065: 'nameAsArray': undeclared identifier
      C:\Qt\6.4.0\msvc2019_64\include\QtCore/qmetatype.h(2354): error C3615: constexpr function 'QtPrivate::QMetaTypeForType<T>::getName' cannot result in a constant expression
              with
              [
                  T=Ty
              ]
      C:\Qt\6.4.0\msvc2019_64\include\QtCore/qmetatype.h(2372): note: failure was caused by control reaching the end of a constexpr function
      

       

       

      Attachments

        1. image-2022-09-16-15-31-54-749.png
          image-2022-09-16-15-31-54-749.png
          282 kB
        2. image-2022-09-16-16-22-07-870.png
          image-2022-09-16-16-22-07-870.png
          192 kB
        3. moc_util.cpp
          28 kB
        4. reg.cpp
          0.2 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            fabiankosmale Fabian Kosmale
            kelteseth Elias Steurer
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: