https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71780
--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> --- N.B. it doesn't matter that you're using map<vector<Small>, int> rather than map<Small, int> directly, because the comparisons on the vector use the comparisons on the Small type, so an invalid ordering for Small produces an invalid ordering for SmallVec too. This still fails: std::vector<Small> va(1, a), vb(1, b); assert( ! ((va < vb) && (vb < va)) );