https://gcc.gnu.org/bugzilla/show_bug.cgi?id=113202
Andrew Pinski <pinskia at gcc dot gnu.org> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |INVALID Status|UNCONFIRMED |RESOLVED --- Comment #7 from Andrew Pinski <pinskia at gcc dot gnu.org> --- Note doing std::find(a, max) where max is outside of the array (or one element more than the array) is undefined code. Which means libstdc++ is working correctly. I suspect you should just use strlen if you want to find the null character in an unbounded array.