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

Warning from qmetatype.h when instanciated from qinputcontrol.cpp

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P3: Somewhat important P3: Somewhat important
    • None
    • 6.11.0 FF
    • Core: Object Model
    • None

      GCC 15 warns in asan + ubsan build:

      [465/661] Building CXX object src/gui/CMakeFiles/Gui.dir/text/qinputcontrol.cpp.o
      In file included from /home/marc/Qt/qtbase-submit-build/include/QtCore/qmetatype.h:1,
                       from /home/marc/Qt/qtbase-submit/src/corelib/kernel/qobject.h:18,
                       from /home/marc/Qt/qtbase-submit-build/include/QtCore/qobject.h:1,
                       from /home/marc/Qt/qtbase-submit/src/gui/text/qinputcontrol_p.h:18,
                       from /home/marc/Qt/qtbase-submit/src/gui/text/qinputcontrol.cpp:4:
      In lambda function,
          inlined from ‘constexpr _Res std::__invoke_impl(__invoke_other, _Fn&&, _Args&& ...) [with _Res = bool; _Fn = QMetaType::registerConverter<QInputControl::selectionWrapper(QMimeData*)::MimeDataSelection, QMimeData*, QMimeData* (*)(const QInputControl::selectionWrapper(QMimeData*)::MimeDataSelection&)>(QMimeData* (*)(const QInputControl::selectionWrapper(QMimeData*)::MimeDataSelection&))::<lambda(const void*, void*)>&; _Args = {const void*, void*}]’ at /d/gcc/15/include/c++/15.2.1/bits/invoke.h:63:36,
          inlined from ‘constexpr std::enable_if_t<((bool)is_invocable_r_v<_Res, _Callable, _Args ...>), _Res> std::__invoke_r(_Callable&&, _Args&& ...) [with _Res = bool; _Callable = QMetaType::registerConverter<QInputControl::selectionWrapper(QMimeData*)::MimeDataSelection, QMimeData*, QMimeData* (*)(const QInputControl::selectionWrapper(QMimeData*)::MimeDataSelection&)>(QMimeData* (*)(const QInputControl::selectionWrapper(QMimeData*)::MimeDataSelection&))::<lambda(const void*, void*)>&; _Args = {const void*, void*}]’ at /d/gcc/15/include/c++/15.2.1/bits/invoke.h:116:35,
          inlined from ‘static _Res std::_Function_handler<_Res(_ArgTypes ...), _Functor>::_M_invoke(const std::_Any_data&, _ArgTypes&& ...) [with _Res = bool; _Functor = QMetaType::registerConverter<QInputControl::selectionWrapper(QMimeData*)::MimeDataSelection, QMimeData*, QMimeData* (*)(const QInputControl::selectionWrapper(QMimeData*)::MimeDataSelection&)>(QMimeData* (*)(const QInputControl::selectionWrapper(QMimeData*)::MimeDataSelection&))::<lambda(const void*, void*)>; _ArgTypes = {const void*, void*}]’ at /d/gcc/15/include/c++/15.2.1/bits/std_function.h:292:30:
      /home/marc/Qt/qtbase-submit/src/corelib/kernel/qmetatype.h:640:20: warning: ‘D.412881’ is used uninitialized [-Wuninitialized]
        640 |             auto &&r = function(*f);
            |                    ^
      /home/marc/Qt/qtbase-submit/src/corelib/kernel/qmetatype.h:640:20: note: ‘D.412881’ was declared here
        640 |             auto &&r = function(*f);
            |                    ^
      

      I'm pretty sure it's due to either the double-implicit conversion of the registered type, or the fact that the type is defined locally in the function. Yes, it's probably a False Positive, but this warning may hit users that attempt to use the same techique, so ideally we'll find a solution for it in qmetatype.h and not just change qinputcontrol.cpp.

      CC fabiankosmale, vestbo.

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

            thiago Thiago Macieira
            mmutz Marc Mutz
            Vladimir Minenko Vladimir Minenko
            Alex Blasche Alex Blasche
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes