Il 19/07/20 12:51, Oswald Buddenhagen ha scritto:
- the compiler somehow starts to actually make use of the freedom
    granted by the fact that QObject is not standard-layout (this, btw, is
    also the reason why peppe's suggestion to use offsetof doesn't fix
    UB).

offsetof is conditionally-supported for non standard layout classes in C++17.:

http://eel.is/c++draft/support.types.layout#1.sentence-2


I haven't found any note in GCC/Clang/MSVC docs saying that they won't support it in this case, hence it's supported.

http://eel.is/c++draft/intro.compliance#:behavior,conditionally-supported


My 2 c,

--
Giuseppe D'Angelo | giuseppe.dang...@kdab.com | Senior Software Engineer
KDAB (France) S.A.S., a KDAB Group company
Tel. France +33 (0)4 90 84 08 53, http://www.kdab.com
KDAB - The Qt, C++ and OpenGL Experts

Attachment: smime.p7s
Description: Firma crittografica S/MIME

_______________________________________________
Development mailing list
Development@qt-project.org
https://lists.qt-project.org/listinfo/development

Reply via email to