Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-20520

QtCreator failed to build with std:c++17 + msvc on windows

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Out of scope
    • Icon: Not Evaluated Not Evaluated
    • Qt Creator 4.14.0-beta1
    • Qt Creator 4.6.1
    • Building Qt Creator
    • None
    • Visual studio 2017 15.7.2 + windows server 2016 +QT 5.11RC
    • d400dce35d817afd719ffadf8c8f43c8814c05c1 (qt-creator/qt-creator/master)

      QtCreator(master branch) with std:c++17  failed due to error C2668, it should be source issue, which involved by QTCreator revision http://code.qt.io/cgit/qt-creator/qt-creator.git/commit/src/plugins/nim?id=522492d85d4ef1db119b4fbfa5d33f9166e7a206,

      Gcc and Clang both reject the code, one possible fix is to remove the second overload if /std:c++17 is used.

       Here is the steps that I used to build QTCreator:
       1. git clone git://code.qt.io/qt-creator/qt-creator.git D:\QTCreator\src
       2. Open a VS 2017 x86 command prompt and browse to D:\QTCreator\src
       3. set _CL_=/D_HAS_AUTO_PTR_ETC=1 /std:c++l7
       4. qmake -r qtcreator.pro
       5. jom

      Failures

      D:\QTCreator\src\src\plugins\nim\project\nimproject.cpp(133): error C2668: 'Utils::transform': ambiguous call to overloaded function
      ..\..\libs\utils/algorithm.h(386): note: could be 'decltype(auto) Utils::transform<std::vector,T,Nim::NimProject::updateProject::<lambda_2bea39ad1c5dda6f046e1cbf9aa18202>,ProjectExplorer::FileNode*,std::unique_ptr<ProjectExplorer::FileNode,std::default_delete<_Ty>>,std::vector<std::unique_ptr<_Ty,std::default_delete<_Ty>>,std::allocator<std::unique_ptr<_Ty,std::default_delete<_Ty>>>>>(SC &&,F)'
              with
              [
                  T=QList<ProjectExplorer::FileNode *>,
                  _Ty=ProjectExplorer::FileNode,
                  SC=QList<ProjectExplorer::FileNode *>,
                  F=Nim::NimProject::updateProject::<lambda_2bea39ad1c5dda6f046e1cbf9aa18202>
              ]
      ..\..\libs\utils/algorithm.h(374): note: or       'decltype(auto) Utils::transform<std::vector,T,Nim::NimProject::updateProject::<lambda_2bea39ad1c5dda6f046e1cbf9aa18202>,ProjectExplorer::FileNode*,std::unique_ptr<ProjectExplorer::FileNode,std::default_delete<_Ty>>,std::vector<std::unique_ptr<_Ty,std::default_delete<_Ty>>,std::allocator<std::unique_ptr<_Ty,std::default_delete<_Ty>>>>>(SC &&,F)'
              with
              [
                  T=QList<ProjectExplorer::FileNode *>,
                  _Ty=ProjectExplorer::FileNode,
                  SC=QList<ProjectExplorer::FileNode *>,
                  F=Nim::NimProject::updateProject::<lambda_2bea39ad1c5dda6f046e1cbf9aa18202>
              ]
      D:\QTCreator\src\src\plugins\nim\project\nimproject.cpp(134): note: while trying to match the argument list '(T, Nim::NimProject::updateProject::<lambda_2bea39ad1c5dda6f046e1cbf9aa18202>)'
              with
              [
                  T=QList<ProjectExplorer::FileNode *>
              ]
      D:\QTCreator\src\src\plugins\nim\project\nimproject.cpp(135): warning C4834: discarding return value of function with 'nodiscard' attribute
      

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

            con Eike Ziller
            phoebehui phoebehui hui
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes