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

Regression: C++ generated from QML throws compiler warning (declaration of unit vs. global declaration)

    XMLWordPrintable

Details

    • All
    • 25f08f305 (dev), 7b5b011ba (6.9), 9500c2334 (6.8)

    Description

      When building the attached application with Qt 6.8.2 and Unity build, the C++ code generated from QML files have multiple "unit" variables shadowing each other. This is visible as compiler warning on GCC:

      warning: declaration of ‘unit’ shadows a global declaration [-Wshadow]

      or on MSVC:

      warning C4459:declaration of 'unit' hides global declaration

      Unity build and warning level are already enabled in the CMakeLists.txt, just build it to reproduce the issue.

      NOTE: This warning does not occur when building with 6.5.8.

      Attachments

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

        Activity

          People

            ulherman Ulf Hermann
            ottoryynanen Otto Ryynänen
            Votes:
            2 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes