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

mingw's windows.foundation.h looks incorrect

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 6.6
    • Build System
    • None
    • bc2675570 (108-based)

    Description

      Download following mingw build:

      https://github.com/cristianadam/mingw-builds/releases/download/v11.2.0-rev3/x86_64-11.2.0-release-posix-seh-rt_v9-rev3.7z

      Try to compile following program and see the output

      #include <windows.foundation.h>
      int main() {
         return 0;
      }
      D:\>C:/opt/mingw64/bin/g++.exe  -std=gnu++17 main.cc -o main.exe
      In file included from main.cc:1:
      C:/opt/mingw64/x86_64-w64-mingw32/include/windows.foundation.h:91:26: error: use of enum 'PropertyType' without previous declaration
         91 |             typedef enum PropertyType PropertyType;
            |                          ^~~~~~~~~~~~
      C:/opt/mingw64/x86_64-w64-mingw32/include/windows.foundation.h:165:18: error: using typedef-name 'ABI::Windows::Foundation::PropertyType' after 'enum'
        165 |             enum PropertyType {
            |                  ^~~~~~~~~~~~
      C:/opt/mingw64/x86_64-w64-mingw32/include/windows.foundation.h:91:39: note: 'ABI::Windows::Foundation::PropertyType' has a previous declaration here
         91 |             typedef enum PropertyType PropertyType;
            |                                       ^~~~~~~~~~~~
      

      Take a look into windows.foundation.h and note:

      • it is autogenerated
      • content is incorrect as compiler complains about doing type aliasing for undeclared enum

      Consider patching it fix it with one of

      • remove bougs enum typedef
      • adding forward declaration :
        enum class PropertyType or enum PropertyType: int;  
        
        ...
                namespace Foundation {
                    enum class PropertyType;
                    typedef enum PropertyType PropertyType;
                }
        ...
        

        It requires also fixing definition later in that header.

      Attachments

        Issue Links

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

          Activity

            People

              cadam Cristian Adam
              michal Michal Klocek
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes