https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91878
--- Comment #6 from Konstantin Kharlamov <Hi-Angel at yandex dot ru> --- (In reply to Jonathan Wakely from comment #5) > No, that's not how undefined behaviour works. You are wrong to expect a crash No, in context of the report I'm not. You're correct this is not how UB works, but this is how address sanitizer does. > and not all cases of undefined behaviour can be detected reliably. Well, given -D_GLIBCXX_DEBUG does handle it, probably sanitizer can either. > As Marc said (and as I suggested on your previous bug report) you should use > -D_GLIBCXX_DEBUG to catch these kind of bugs. Right, thanks, FTR: my prev. report was handled by sanitizer correctly, so back then I wouldn't need to use the additional debugging option.