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

"private field is not used" build errors in testlib/qtestevent.h with Clang 7

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: P2: Important
    • Resolution: Unresolved
    • Affects Version/s: 5.9.8
    • Fix Version/s: None
    • Component/s: Testing: qtestlib
    • Labels:
      None
    • Environment:
      Arch Linux
    • Platform/s:
      Linux/X11

      Description

      clang++ -c -pipe -g -std=c++1z -fvisibility=hidden -fvisibility-inlines-hidden -Wall -W -Wdate-time -D_REENTRANT -fPIC -DQT_NO_CAST_TO_ASCII -DQT_NO_CAST_FROM_ASCII -DQT_NO_FOREACH -DQT_NO_DATASTREAM -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DQT_BUILD_TESTLIB_LIB -DQT_BUILDING_QT -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x050000 -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_CORE_LIB -Wall -Wextra -Werror -Woverloaded-virtual -Wshadow -Wundef -Wfloat-equal -Wnon-virtual-dtor -Wpointer-arith -Wformat-security -Wno-long-long -Wno-variadic-macros -pedantic-errors -Wchar-subscripts -Wold-style-cast -Wcast-align -Wdouble-promotion -I/home/rutledge/dev/qt59/qtbase/src/testlib -I. -I../../include -I../../include/QtTest -I../../include/QtTest/5.9.8 -I../../include/QtTest/5.9.8/QtTest -I../../include/QtCore/5.9.8 -I../../include/QtCore/5.9.8/QtCore -I../../include/QtCore -I.moc -I/home/rutledge/dev/qt59/qtbase/mkspecs/linux-clang -DQT_NO_CAST_TO_ASCII=1 -DQT_NO_CAST_FROM_ASCII=1 -UQT_RESTRICTED_CAST_FROM_ASCII -DQT_STRICT_ITERATORS -DQT_NO_URL_CAST_FROM_STRING=1 -DQT_NO_CAST_FROM_BYTEARRAY=1 -DQT_NO_KEYWORDS=1 -DQT_USE_QSTRINGBUILDER -DQT_USE_FAST_OPERATOR_PLUS -Dsignals=int -Dslots=int -Demit=public: -Dforeach=public: -Dforever=public: -xc++ /home/rutledge/dev/qt59/qtbase/src/testlib/qtest_gui.h -o .obj/header_qtest_gui.o
      In file included from ../../include/QtTest/../../../../qt59/qtbase/src/testlib/qtest_gui.h:53:
      In file included from ../../include/QtTest/qtestevent.h:1:
      ../../include/QtTest/../../../../qt59/qtbase/src/testlib/qtestevent.h:119:9: error: private field '_delay' is not used [-Werror,-Wunused-private-field]
          int _delay;
              ^
      ../../include/QtTest/../../../../qt59/qtbase/src/testlib/qtestevent.h:138:24: error: private field '_action' is not used [-Werror,-Wunused-private-field]
          QTest::MouseAction _action;
                             ^
      ../../include/QtTest/../../../../qt59/qtbase/src/testlib/qtestevent.h:139:21: error: private field '_button' is not used [-Werror,-Wunused-private-field]
          Qt::MouseButton _button;
                          ^
      ../../include/QtTest/../../../../qt59/qtbase/src/testlib/qtestevent.h:142:9: error: private field '_delay' is not used [-Werror,-Wunused-private-field]
          int _delay;
              ^
      ../../include/QtTest/../../../../qt59/qtbase/src/testlib/qtestevent.h:158:9: error: private field '_delay' is not used [-Werror,-Wunused-private-field]
          int _delay;
              ^
      5 errors generated.
       

      But they are used if QT_WIDGETS_LIB is defined:

      #ifdef QT_WIDGETS_LIB
          inline void simulate(QWidget *w) override
          {
              QTest::keyClicks(w, _keys, _modifiers, _delay);
          }
      #endif
      
      private:
          QString _keys;
          Qt::KeyboardModifiers _modifiers;
          int _delay;
      

      and I configured Qt with widget support as usual, so this doesn't make much sense.

        Attachments

          Issue Links

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

            Activity

              People

              Assignee:
              srutledg Shawn Rutledge
              Reporter:
              srutledg Shawn Rutledge
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:

                  Gerrit Reviews

                  There are no open Gerrit changes