https://bugs.kde.org/show_bug.cgi?id=374568
--- Comment #11 from RJVB <rjvber...@gmail.com> --- (In reply to Yichao Yu from comment #10) > I agree the code is likely UB. Still curious why it only crashes on your > setup and what code the compiler actually generate. When the method is If UB = undefined behaviour in this context then it wouldn't be the first time a change in GCC made things go weird that always worked. Then again, there's only 1 way to be certain about it (and that it's not a regression in the compiler): ask on the gcc ML or bugzilla. But isn't cppcheck supposed to catch known cases of undefined behaviour and doesn't gcc itself have an option to warn about them? It still is surprising though that this code has been in use for years on many different platforms and with different compilers (Mac and Linux, gcc and clang on both in my case), without ever causing trouble. Usually that kind of wide-spread application tends to bring out the very subtle bugs. > protected, would the following work? > struct HackedMenu: public QMenuBar { > static void send(QMenuBar *menubar, QMouseEvent *event) That's no longer really a HackedMenu, just a WrappedMenu ;) -- You are receiving this mail because: You are watching all bug changes.