qt6-bb10/tests/auto/corelib
Volker Hilsheimer 2b9ef2eb44 Pacify MSVC compiler incorrectly warning about unused variable
Under some circumstances, MSVC seems to complain about SlotArgumentCount
being unused

  qobject.h(210): warning C4189: 'SlotArgumentCount': local variable is
  initialized but not referenced
  note: see reference to function template instantiation
  'QMetaObject::Connection QObject::connect<void(__cdecl QAction::* )(bool),
  main::<lambda_1>>(const QAction *,Func1,
    const QtPrivate::ContextTypeForFunctor<main::<lambda_1>,void>::ContextType *,
    Func2 &&,Qt::ConnectionType)' being compiled

This is nonsense, as SlotArgumentCount is used in the next line, to
construct the list of signal arguments, but the workaround to declare
the variable as [[maybe_unused]] is trivial.

Add a connect statement to the test case that creates such a connection.
This does not produce any warning with or without the attribute (and if
it did, the build would fail for CI configuratinos setting -Werror).

Pick-to: 6.6
Fixes: QTBUG-114781
Change-Id: I4ee6f7d57c2836ef3dd9741d037d48181af2cdec
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
2023-06-22 13:20:26 +00:00
..
animation QPauseAnimation test: add QNX to platforms that might fail 2023-05-25 14:06:50 +02:00
global Replace {add,sub,mul}_overload with q{Add,Sub,Mul}Overload 2023-06-12 13:11:26 +00:00
io QProcess/Unix: fix setting SIGPIPE to SIG_IGN where SIG_DFL was intended 2023-06-21 11:12:42 -07:00
ipc IPC: tst_QNativeIpcKey: rename duplicate row in test 2023-04-28 22:30:13 -05:00
itemmodels Remove unused variables 2023-04-19 12:55:02 +02:00
kernel Pacify MSVC compiler incorrectly warning about unused variable 2023-06-22 13:20:26 +00:00
mimetypes QMimeDatabase: de-duplicate some code in the unittests 2023-05-07 14:29:28 +03:00
platform Don't add prefix for BaseName 2023-06-16 22:54:36 +03:00
plugin QLibraryPrivate: Actually merge load hints 2023-06-20 15:41:20 +02:00
serialization Shoehorn AccentColor into QPalette and keep existing 64bit resolve mask 2023-05-21 18:36:37 +02:00
text QStringBuilder: allow to be used with 'auto' keyword 2023-06-13 20:01:37 +00:00
thread QFutureSynchronizer: fix aliasing problem in setFuture() 2023-06-21 14:20:42 +00:00
time Add test-cases for QDate::{start,end}OfDay() at QDateTime's bounds 2023-05-15 14:02:41 +02:00
tools tst_containerapisymmetry: check that std::size() works 2023-06-09 12:32:48 +00:00
CMakeLists.txt tests: Remove remains of qmake conversion from CMakeLists.txt files 2023-02-17 21:56:49 +01:00