https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87037
Jonathan Wakely <redi at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution|--- |INVALID --- Comment #1 from Jonathan Wakely <redi at gcc dot gnu.org> --- There's nothing strange about that at all. There are plenty of uses for erase where it's totally fine to ignore the return value. auto iter = std::find(v.begin(), v.end(), val); if (iter != v.end()) { do_something(*iter); v.erase(iter); } How do you propose to mark it so it only complains when you have a bug?