Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.10.1
-
5b99f3a34fef527beb8767eb12657f81ee65b969 (qt/qtbase/dev)
Description
In case a parameter is of type that overrides operator&, it causes problems for moc generated code which would take the result of operator&() instead of the object address. Using std::addressof() in those cases should work better.
For example:
class F : public QObject { Q_OBJECT public: void* operator&() { return nullptr; } signals: void something(F&); };
Results in this, where it causes _a[1] to be nullptr as it calls F::operator&():
// SIGNAL 0 void F::something(F & _t1) { void *_a[] = { nullptr, const_cast<void*>(reinterpret_cast<const void*>(&_t1)) }; QMetaObject::activate(this, &staticMetaObject, 0, _a); }