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

Reg->6.6/MSVC: Compile warning about Unused SlotArgumentCount in lambda connect

    XMLWordPrintable

Details

    • Windows
    • 2b9ef2eb4 (dev), 343fa701e (6.6)

    Description

      Code like

       QObject::connect(a, &QAction::triggered, &w,  []() { qDebug(__FUNCTION__); });
       

      triggers

      main.cpp
      C:\Qt\6.6.0\msvc2019_64\include\QtCore/qobject.h(210): warning C4189: 'SlotArgumentCount': local variable is initialized but not referenced
      ..\untitled\main.cpp(16): 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
              with
              [
                  Func1=void (__cdecl QAction::* )(bool),
                  Func2=main::<lambda_1>
              ]
      	link /NOLOGO /DYNAMICBASE /NXCOMPAT /DEBUG /SUBSYSTEM:WINDOWS "/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" /MANIFEST:embed /OUT:debug\untitled.exe @C:\temp\untitled.exe.3368.2422.jom
      

      with

      Microsoft (R) C/C++ Optimizing Compiler Version 19.36.32535 for x64
      

      Attachments

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

        Activity

          People

            vhilshei Volker Hilsheimer
            kleint Friedemann Kleint
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes