20a1526a23
When being queried for QMetaObject::IndexOfMethod, qt_static_metacall would compare the argument with each of the class' methods' addresses. Taking the address of an overloaded function is ambiguous unless you cast to the right type, which the moc-generated code did using explicit static_cast<>s. If the function is not overloaded, GCC would warn about the static_cast<> being "useless", which isn't wrong. Fix by using an implicit cast to a local variable of the correct type instead of an explicit cast. Since there's no explicit cast anymore, GCC doesn't warn. Code before the change: using _t = void(Counter::*)(int ); if (*reinterpret_cast<_t*>(_a[1]) == static_cast<_t>(&Counter::valueChanged)) { ^-------------------------------------- -Wuseless-cast *result = 0; return; } After: using _t = void(Counter::*)(int ); if (_t _q_method = &Counter::valueChanged; *reinterpret_cast<_t*>(_a[1]) == _q_method) { *result = 0; return; } Since we're using a C++17 construct, we can't pick to 5.15. Pick-to: 6.4 6.3 6.2 Fixes: QTBUG-71938 Change-Id: If6ba4bf17b3bf7f64e9662ba9d085273882fb460 Reviewed-by: Mate Barany <mate.barany@qt.io> Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> |
||
---|---|---|
.github/workflows | ||
bin | ||
cmake | ||
coin | ||
config.tests | ||
dist | ||
doc | ||
examples | ||
lib | ||
libexec | ||
LICENSES | ||
mkspecs | ||
qmake | ||
src | ||
tests | ||
util | ||
.cmake.conf | ||
.gitattributes | ||
.gitignore | ||
.lgtm.yml | ||
.tag | ||
CMakeLists.txt | ||
conanfile.py | ||
config_help.txt | ||
configure | ||
configure.bat | ||
configure.cmake | ||
dependencies.yaml | ||
qt_cmdline.cmake | ||
sync.profile |