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

Build fails with clang-cl 12.0.0

    XMLWordPrintable

Details

    • Windows
    • 00b580427071acb9341bc49fe37e289201cbf02c (qt/qtdeclarative/dev) c4f4fcfae8a8154f8b40c31885a3cdcc8ab63847 (qt/qtdeclarative/6.2)

    Description

      When building qtdeclarative with clang-cl 12.0.0 the compilation fails with:

      FAILED: src/quick/CMakeFiles/Quick.dir/items/qquickitemsmodule.cpp.obj
      C:\PROGRA~1\LLVM\bin\clang-cl.exe  /nologo -TP -DQT_ASCII_CAST_WARNINGS -DQT_BUILDING_QT -DQT_BUILD_QUICK_LIB -DQT_CORE_LIB -DQT_DEPRECATED_WARNINGS -DQT_DEPRECATED_WARNINGS_SINCE=0x060000 -DQT_DISABLE_DEPRECATED_BEFORE=0x040800 -DQT_GUI_LIB -DQT_MOC_COMPAT -DQT_NETWORK_LIB -DQT_NO_CAST_TO_ASCII -DQT_NO_DEBUG -DQT_NO_EXCEPTIONS -DQT_NO_FOREACH -DQT_NO_INTEGER_EVENT_COORDINATES -DQT_NO_URL_CAST_FROM_STRING -DQT_OPENGL_LIB -DQT_QMLMODELS_LIB -DQT_QML_LIB -DQT_USE_QSTRINGBUILDER -DQuick_EXPORTS -DUNICODE -DWIN32 -DWIN64 -D_CRT_SECURE_NO_WARNINGS -D_ENABLE_EXTENDED_ALIGNED_STORAGE -D_UNICODE -D_USE_MATH_DEFINES -D_WIN64 -D_WINDLL -Isrc\quick\Quick_autogen\include -Iinclude -Iinclude\QtQuick -IC:\Projects\Qt\repo\qtdeclarative\src\quick -Isrc\quick -Iinclude\QtQuick\6.2.0 -Iinclude\QtQuick\6.2.0\QtQuick -Isrc\qml -Iinclude\QtQml\6.2.0 -Iinclude\QtQml\6.2.0\QtQml -Iinclude\QtQml -Iinclude\QtQmlModels -Isrc\qmlmodels -Iinclude\QtQmlModels\6.2.0 -Iinclude\QtQmlModels\6.2.0\QtQmlModels -imsvc C:\Projects\Qt\install-clang-cl\include\QtCore\6.2.0 -imsvc C:\Projects\Qt\install-clang-cl\include\QtCore\6.2.0\QtCore -imsvc C:\Projects\Qt\install-clang-cl\include\QtCore -imsvc C:\Projects\Qt\install-clang-cl\include -imsvc C:\Projects\Qt\install-clang-cl\mkspecs\win32-clang-msvc -imsvc C:\Projects\Qt\install-clang-cl\include\QtNetwork -imsvc C:\Projects\Qt\install-clang-cl\include\QtGui -imsvc C:\Projects\Qt\install-clang-cl\include\QtGui\6.2.0 -imsvc C:\Projects\Qt\install-clang-cl\include\QtGui\6.2.0\QtGui -imsvc C:\Projects\Qt\install-clang-cl\include\QtOpenGL -imsvc C:\Projects\Qt\install-clang-cl\include\QtOpenGL\6.2.0 -imsvc C:\Projects\Qt\install-clang-cl\include\QtOpenGL\6.2.0\QtOpenGL /DWIN32 /D_WINDOWS /GR /DNDEBUG -O2 -MD /W3 /wd4530 /wd4577 -Zc:__cplusplus -permissive- -utf-8 -Wno-ignored-attributes -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:wchar_t -guard:cf -std:c++17 /YuC:/Projects/Qt/build-clang-cl-qtdeclarative/src/quick/CMakeFiles/Quick.dir/cmake_pch.hxx /FpC:/Projects/Qt/build-clang-cl-qtdeclarative/src/quick/CMakeFiles/Quick.dir/./cmake_pch.cxx.pch /FIC:/Projects/Qt/build-clang-cl-qtdeclarative/src/quick/CMakeFiles/Quick.dir/cmake_pch.hxx /showIncludes /Fosrc\quick\CMakeFiles\Quick.dir\items\qquickitemsmodule.cpp.obj /Fdsrc\quick\CMakeFiles\Quick.dir\ -c -- C:\Projects\Qt\repo\qtdeclarative\src\quick\items\qquickitemsmodule.cpp
      In file included from C:\Projects\Qt\repo\qtdeclarative\src\quick\items\qquickitemsmodule.cpp:43:
      In file included from C:\Projects\Qt\repo\qtdeclarative\src\quick\items/qquickitem_p.h:59:
      In file included from include\QtQuick\6.2.0\QtQuick/private/qquickstate_p.h:1:
      In file included from include\QtQuick\6.2.0\QtQuick\private/../../../../../../repo/qtdeclarative/src/quick/util/qquickstate_p.h:60:
      In file included from include\QtQml\6.2.0\QtQml\private/qqmlanybinding_p.h:1:
      In file included from include\QtQml\6.2.0\QtQml/private/../../../../../../repo/qtdeclarative/src/qml/qml/qqmlanybinding_p.h:55:
      In file included from include\QtQml\6.2.0\QtQml\private/qqmlpropertybinding_p.h:1:
      include\QtQml\6.2.0\QtQml/private/../../../../../../repo/qtdeclarative/src/qml/qml/qqmlpropertybinding_p.h(214,40): error: constexpr variable 'bindingFunctionVTable<QQmlPropertyBinding>' must be initialized by a constant expression
      inline constexpr BindingFunctionVTable bindingFunctionVTable<QQmlPropertyBinding> = { 

      The following patch fixes it, but I'm sure it's not the correct fix:

      diff --git a/src/qml/qml/qqmlpropertybinding_p.h b/src/qml/qml/qqmlpropertybinding_p.h
      index 341e300de4..f39b9abc42 100644
      --- a/src/qml/qml/qqmlpropertybinding_p.h
      +++ b/src/qml/qml/qqmlpropertybinding_p.h
      @@ -211,7 +211,7 @@ struct Print {};
      
       namespace QtPrivate {
       template<>
      -inline constexpr BindingFunctionVTable bindingFunctionVTable<QQmlPropertyBinding> = {
      +inline /*constexpr*/ BindingFunctionVTable bindingFunctionVTable<QQmlPropertyBinding> = {
           &QQmlPropertyBinding::doEvaluate,
           [](void *qpropertyBinding){
               QQmlPropertyBinding *binding = reinterpret_cast<QQmlPropertyBinding *>(qpropertyBinding);
      

      I don't know if this is a compiler bug, or something clang-cl specific.

      Attachments

        For Gerrit Dashboard: QTBUG-95575
        # Subject Branch Project Status CR V

        Activity

          People

            fabiankosmale Fabian Kosmale
            cadam Cristian Adam
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes