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

QTestEvent duplicate vtables

    XMLWordPrintable

Details

    • Task
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • None
    • Testing: qtestlib
    • None

    Description

      The QTestEvent hierarchy is a collection of all-inline classes which change number and layout depending on whether QT_GUI_LIB and/or QT_WIDGETS_LIB is defined. As a polymorphic class hierarchy with all-inline members, it will create duplicated vtables and fall prey to Clang's -Wweak-vtable, recently added to our headersclean check.

      We've silenced the Clang warning for now by using a bug in Clang which makes it not emit the warning when making the dtor = default (even though the dtor will still be inline and produce weak vtables), but we need to fix this properly, esp. since it's also an ODR violation to change the vtable layout between TUs.

      The proper way to deal with this would be to offload all the Gui- and Widgets-related parts of QtTest (which itself only links to QtCore) into QtTestGui, QtTestWidgets libraries. QTestLib isn't under BC constraints, so this could even happen before Qt 7.

      Attachments

        Issue Links

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

          Activity

            People

              cnn Qt Core & Network
              mmutz Marc Mutz
              Vladimir Minenko Vladimir Minenko
              Alex Blasche Alex Blasche
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes