https://gcc.gnu.org/bugzilla/show_bug.cgi?id=91878 --- Comment #3 from Marc Glisse <glisse at gcc dot gnu.org> --- -D_GLIBCXX_DEBUG is the current way to add many checks to libstdc++, and it detects this.