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

Qt 6.1/6.1.1 compilation fails after MSVC 2019 16.10 update with "/std:c++latest" compiler flag

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P2: Important
    • None
    • 6.1.0, 6.1.1
    • Core: Other
    • None
    • Windows

    Description

      Qt 6.1 and 6.1.1RC with MSVC 2019 16.10.31321.278 both fail on compilation of a cmake project set to c++ 20 standard with:

      C:\Qt\6.1.1\msvc2019_64\include\QtCore/qproperty.h(53): fatal error C1083: Cannot open include file: 'experimental/source_location': No such file or directory

      Changing L53 to
      #include <source_location>
      fixes this error.

      Compilation now fails with:
      C:\Qt\6.1.1\msvc2019_64\include\QtCore/qproperty.h(100): error C3083: 'experimental': the symbol to the left of a '::' must be a type

      Changing L100 to
      QPropertyBindingSourceLocation(const std::source_location &cppLocation)

      will successfully build the application.

      CMAKE Compiler output:
      "The CXX compiler identification is MSVC 19.29.30037.0"

       

      Relevant CMake setup:

      set(CMAKE_CXX_STANDARD 20)

      set(CMAKE_CXX_STANDARD_REQUIRED ON) 

      set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /O2 /arch:AVX2 /Qpar /EHsc /Gw /Gy /std:c++latest") 

       

      This may be sort of related to QTBUG-93270/QTBUG-93966.

      Attachments

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

        Activity

          People

            fabiankosmale Fabian Kosmale
            derreisende77 Christian F
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes