On Saturday, 18 July 2020 07:11:51 PDT Giuseppe D'Angelo via Development wrote: > > auto prop = object->propertyName; > > return prop.value(); > > How? Just like QStringBuilder, there's no way to block a `const auto &`, > is there?
A reference is ok. The problem is the copy or move, since now the object's this no longer points to the dummy member inside the QObject-derived class, but to somewhere on the stack. Then that UB pointer manipulation begins reading garbage and making matters go from bad to worse. -- Thiago Macieira - thiago.macieira (AT) intel.com Software Architect - Intel System Software Products _______________________________________________ Development mailing list Development@qt-project.org https://lists.qt-project.org/listinfo/development