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

qwindowsservices.cpp doesn't compile with mingw64 GCC 10.1.0

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.15.2
    • 5.15.1
    • Build System
    • None
    • x86_64-w64-mingw32-g++ (GCC) 10.1.0
      i686-w64-mingw32-g++ (GCC) 10.1.0
    • Windows
    • 983132212c7f3541a8c5fbaf4c5309d92345107f (qt/qtbase/dev) a1d85aef7132084800ca7c62ae6b5631093103d6 (qt/qtbase/5.15)

    Description

       

      Starting with qt 5.15.1 the compilation fails with

      x86_64-w64-mingw32-g++ -c -pipe -fno-keep-inline-dllexport -isystem /vlc/contrib/x86_64-w64-mingw32/include -O2 -std=c++1z -fno-exceptions -Wall -Wextra -Wextra -Wvla -Wdate-time -Wshift-overflow=2 -Wduplicated-cond -Wno-stringop-overflow -Wno-format-overflow -ffunction-sections -fdata-sections -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -DWINVER=0x0601 -D_WIN32_WINNT=0x0601 -DQT_NO_LINKED_LIST -DQT_NO_JAVA_STYLE_ITERATORS -DQT_NO_CAST_FROM_ASCII -DQT_NO_FOREACH -DLIBEGL_NAME=libEGL -DLIBGLESV2_NAME=libGLESv2 -DQT_DEPRECATED_WARNINGS -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DQT_NO_EXCEPTIONS -DQT_NO_DEBUG -DQT_STATICPLUGIN -DQT_PLUGIN -DQT_EVENTDISPATCHER_SUPPORT_LIB -DQT_FONTDATABASE_SUPPORT_LIB -DQT_THEME_SUPPORT_LIB -DQT_ACCESSIBILITY_SUPPORT_LIB -DQT_WINDOWSUIAUTOMATION_SUPPORT_LIB -DQT_GUI_LIB -DQT_CORE_LIB -DQT_PLUGIN_RESOURCE_INIT_FUNCTION=qwindows_plugin_resource_init -DGL_APICALL= -DEGLAPI= -I. -I. -I../../../3rdparty/wintab -I../../../../include -I../../../../include/QtEventDispatcherSupport -I../../../../include/QtEventDispatcherSupport/5.15.1 -I../../../../include/QtEventDispatcherSupport/5.15.1/QtEventDispatcherSupport -I../../../../include/QtFontDatabaseSupport -I../../../../include/QtFontDatabaseSupport/5.15.1 -I../../../../include/QtFontDatabaseSupport/5.15.1/QtFontDatabaseSupport -I../../../../include/QtThemeSupport -I../../../../include/QtThemeSupport/5.15.1 -I../../../../include/QtThemeSupport/5.15.1/QtThemeSupport -I../../../../include/QtAccessibilitySupport -I../../../../include/QtAccessibilitySupport/5.15.1 -I../../../../include/QtAccessibilitySupport/5.15.1/QtAccessibilitySupport -I../../../../include/QtWindowsUIAutomationSupport -I../../../../include/QtWindowsUIAutomationSupport/5.15.1 -I../../../../include/QtWindowsUIAutomationSupport/5.15.1/QtWindowsUIAutomationSupport -I../../../../include/QtGui/5.15.1 -I../../../../include/QtGui/5.15.1/QtGui -I../../../../include/QtGui -I../../../../include/QtANGLE -I../../../../include/QtCore/5.15.1 -I../../../../include/QtCore/5.15.1/QtCore -I../../../../include/QtCore -I.moc/release -I../../../../mkspecs/win32-g++  -o .obj/release/qwindowsservices.o qwindowsservices.cpp
      qwindowsservices.cpp: In function 'bool shellExecute(const QUrl&)':
      qwindowsservices.cpp:81:45: error: 'create' is not a member of 'QThread'
         81 |     QScopedPointer<QThread> thread(QThread::create([path, resultPtr]
            |

      this seems to be a regression introduced by 45d340851d5f88fb27fb7be011079fa1ae238a3f which adds

          QScopedPointer<QThread> thread(QThread::create([path, resultPtr]
                                                          () { *resultPtr = runShellExecute(path); }));
      
      

      but QThread::create is unavailable as it is defined as:

      #ifdef Q_CLANG_QDOC
          template <typename Function, typename... Args>
          static QThread *create(Function &&f, Args &&... args);
          template <typename Function>
          static QThread *create(Function &&f);
      #else
      #  if QT_CONFIG(cxx11_future)
      #    ifdef QTHREAD_HAS_VARIADIC_CREATE
          template <typename Function, typename... Args>
          static QThread *create(Function &&f, Args &&... args);
      #    else
          template <typename Function>
          static QThread *create(Function &&f);
      #    endif // QTHREAD_HAS_VARIADIC_CREATE                                                                                                                                                                           
      #  endif // QT_CONFIG(cxx11_future)                                                                                                                                                                                 
      #endif // Q_CLANG_QDOC
      

      and cxx11_future does not seems to be present for this compiler

      $> grep  cxx11_future  config.cache 
      cache.cxx11_future._KEYS_ = result msgs
      cache.cxx11_future.result = false
      cache.cxx11_future.msgs = "+ cd /vlc/contrib/contrib-win64/qt/config.tests/cxx11_future && /vlc/contrib/contrib-win64/qt/bin/qmake \"CONFIG -= qt debug_and_release app_bundle lib_bundle\" \"CONFIG += static warn_off console single_arch\" -early \"CONFIG += cross_compile\" /vlc/contrib/contrib-win64/qt/config.tests/cxx11_future" "+ cd /vlc/contrib/contrib-win64/qt/config.tests/cxx11_future && MAKEFLAGS= /usr/bin/make" "> make[1]: Entering directory \'/vlc/contrib/contrib-win64/qt/config.tests/cxx11_future\'" "> x86_64-w64-mingw32-g++ -c -pipe -fno-keep-inline-dllexport -isystem /vlc/contrib/x86_64-w64-mingw32/include -O2 -w -fexceptions -mthreads -DUNICODE -D_UNICODE -DWIN32 -DMINGW_HAS_SECURE_API=1 -I. -I/vlc/contrib/contrib-win64/qt/mkspecs/win32-g++  -o main.o main.cpp" "> main.cpp: In function \'int main(int, char**)\':" "> main.cpp:7:22: error: variable \'std::future<int> f\' has initializer but incomplete type" ">     7 |     std::future<int> f = std::async([]() { return 42; });" ">       |                      ^" "> main.cpp:7:56: error: invalid use of incomplete type \'class std::future<int>\'" ">     7 |     std::future<int> f = std::async([]() { return 42; });" ">       |                                                        ^" "> In file included from main.cpp:2:" "> /opt/gcc-x86_64-w64-mingw32/x86_64-w64-mingw32/include/c++/10.1.0/future:125:11: note: declaration of \'class std::future<int>\'" ">   125 |     class future;" ">       |           ^~~~~~" "> /opt/gcc-x86_64-w64-mingw32/x86_64-w64-mingw32/include/c++/10.1.0/future: At global scope:" "> /opt/gcc-x86_64-w64-mingw32/x86_64-w64-mingw32/include/c++/10.1.0/future:193:5: error: \'std::future<typename std::__invoke_result<typename std::decay<_Tp>::type, typename std::decay<_Args>::type ...>::type> std::async(_Fn&&, _Args&& ...) [with _Fn = main(int, char**)::<lambda()>; _Args = {}; typename std::__invoke_result<typename std::decay<_Tp>::type, typename std::decay<_Args>::type ...>::type = int]\', declared using local type \'main(int, char**)::<lambda()>\', is used but never defined [-fpermissive]" ">   193 |     async(_Fn&& __fn, _Args&&... __args);" ">       |     ^~~~~" "> Makefile:176: recipe for target \'main.o\' failed" "> make[1]: *** [main.o] Error 1" "> make[1]: Leaving directory \'/vlc/contrib/contrib-win64/qt/config.tests/cxx11_future\'"

       

       

      Attachments

        Issue Links

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

          Activity

            People

              kkohne Kai Köhne
              chub Pierre Lamot
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes