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

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

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Not Evaluated
    • Resolution: Out of scope
    • Affects Version/s: Qt Creator 4.6.1
    • Fix Version/s: Qt Creator 4.14.0-beta1
    • Component/s: Building Qt Creator
    • Labels:
      None
    • Environment:
      Visual studio 2017 15.7.2 + windows server 2016 +QT 5.11RC
    • Commits:
      d400dce35d817afd719ffadf8c8f43c8814c05c1 (qt-creator/qt-creator/master)

      Description

      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
      

        Attachments

          Issue Links

          For Gerrit Dashboard: QTCREATORBUG-20520
          # Subject Branch Project Status CR V

            Activity

              People

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

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes