On Mon, 15 Jun 2020, Jonathan Wakely wrote: > On Mon, 15 Jun 2020 at 18:34, Tibor Billes <tbilles@xxxxxxx> wrote: > > > > Hi, > > > > I'm using the -fsanitize=undefined flag and got a runtime error after a > > compiler upgrade from 7.2 to 9.3. I was happy at first that the upgraded > > compiler caught an error that I can fix before it hits me in production. > > > > However after some investigation, I cannot figure out what's wrong in the > > code. That's why I seek help on this mailing list, can someone explain > > the bug to me? Or is it a bug in the compiler that I should report? > > > > The simplified version of the test code on Compiler Explorer: > > https://godbolt.org/z/7rAxJj > > > > It shows that different compiler versions behave differently. > > > > There is a comment on line 16 that explicitly defaults the Derived > > constructor. If you switch the comment with line 17, both compiler verions > > run fine without producing the runtime error although the defaulted > > constructor should be exactly the same the user defined one: > > https://godbolt.org/z/UShm-u > > > > Can someone please explain what's wrong? > > Looks like a bug, please do report it to bugzilla, thanks. > Ok, here it is: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=95693 . Thanks for your quick response! Tibor