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

qmlintegration.h macros cause GCC -Wredundant-decls

XMLWordPrintable

    • df3c82f6a (dev), 2b772c92a (6.7), a7212f9ed (tqtc/lts-6.5)

      After QTBUG-115583 reported that GCC's -Wredundant-decls got triggered in QPageSize, I tried adding that flag to headersclean. This brought to light that various QML_ macros contain a friend declaration for QML_REGISTER_TYPES_AND_REVISIONS. If a type such as QtGraph's QAbstractAxis contains more than one of these macros (in that case QML_FOREIGN and QML_UNCREATABLE), the friend declaration is duplicated in the macro expanded class declaration, triggering -Wredundant-decls.

      Solutions could be to combine the macros, so only one is necessary (QML_UNCREATABLE_FOREIGN) or each macro giving access to a different struct, which then is used by qmlRegisterTypesAndRevisions to access the relevant parts of the actual class.

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

            fabiankosmale Fabian Kosmale
            mmutz Marc Mutz
            Vladimir Minenko Vladimir Minenko
            Alex Blasche Alex Blasche
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes