On Friday, 24 July 2020 00:20:46 PDT Olivier Goffart wrote: > You do not need to use the empty array everywhere: only in the helper type > created by the Q_PRIVATE_QPROPERTY macro. And it can be conditioned on > pre-c++20 GCC.
The problem is that it is in QObject and other Qt classes. That's why I meant "everywhere". See its warnings with -pedantic: https://godbolt.org/z/cYbbG3 though of course it can be disabled: https://godbolt.org/z/zdbePj This feature is GCC's extension that was there prior to C99 Flexible Array Members (FAMs use x[] as a syntax, not x[0]). As an extension that has been superseded, it can disappear at any time. Though I'll grant you again that a future compiler that does disappear it is one that will support [[no_unique_address]]. In all, I think we have enough workarounds for this, for past compilers. Can I suggest that we prepare at least two papers for the standard? One for the member-to-containing-object trick and the second for what QProperty really is: sub-scope of a class. We don't want a different this pointer, we just want to scope. -- Thiago Macieira - thiago.macieira (AT) intel.com Software Architect - Intel DPG Cloud Engineering _______________________________________________ Development mailing list Development@qt-project.org https://lists.qt-project.org/listinfo/development