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

Build error in Windows Visual Studio 2019, c++20 referring to std::popcount

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 6.2.0 Alpha
    • 6.0.0
    • Build System
    • None
    • Windows, Visual Studio 2019
    • Windows
    • 647c0e80ed2e190778016c4208b5d6f1f9fd6543 (qt/qtbase/dev)

    Description

      In qlagorithms.h, the function qPopulationCount, the reference to std::popcount fails to compile  when using C++20. 

      : error C2039: 'popcount': is not a member of 'std'
      1>C:\Qt\6.0.0\msvc2019_64\include\QtCore\qhashfunctions.h(303): message : see declaration of 'std'

      In Windows,  the following header is required to define std::popcount

      #include <bit>

      https://docs.microsoft.com/en-us/cpp/standard-library/bit-functions?view=msvc-160#popcount

      Attachments

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

        Activity

          People

            kkohne Kai Köhne
            doug_rogers Doug Rogers
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: