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

Warning on MSVC 2019 in QML prevents building with /WX

    XMLWordPrintable

Details

    • Windows

    Description

      When building the small attached example is a minimal example showing an error on Windows 11 with Qt 6.3.1 using Microsoft Visual C++ Compiler 17.2.32630.192 (amd64). The bug only manifests itself with the MSVC compiler and warning level /W4. MinGW 11.2.0 does not show the same warning, neither does warning level /W3.

      The warning appears during compilation in main_qml.cpp (line 484) and reads: "C4456: Declaration of 'argType' hides previous local declaration." Since I have /Wx (treat warnings as errors) enabled the compilation fails.

      Steps to reproduce:

      • Configure CMake
      • Click compile
      • Result: Warning appears in main_qml.cpp (line 592) which says: "Declaration of 'argType' hides previous local declaration."
      • Expected: No warning appears

       

      You can find the minimal example also here: https://github.com/Foaly/Qt-Bugs/tree/master/msvc19_c4456_warning

      Attachments

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

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            m.wagenbach Maximilian Wagenbach
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes