https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68409
Adrian Wielgosik <adrian.wielgosik at gmail dot com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |adrian.wielgosik at gmail dot com --- Comment #2 from Adrian Wielgosik <adrian.wielgosik at gmail dot com> --- Your operator< doesn't seem to satisfy strict weak ordering. Once I rewrote it to a basic but safer version: bool operator< (const chave& lhs, const chave& rhs) { if(lhs.numeros_ord != rhs.numeros_ord) return lhs.numeros_ord < rhs.numeros_ord; return lhs.estrelas_ord < rhs.estrelas_ord; } It seems to work fine to me. (Also, when testing with clang/GCC, try using AddressSanitizer or valgrind, you'll have a better chance of catching illegal memory accesses.)