https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71004
--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> --- (In reply to Eric Fiselier from comment #1) > recursive_directory_iterator it; > assert(it.recursion_pending() == false); > assert(it.recursion_pending() == true); N.B. This test is undefined, those observer functions have preconditions that they are not called on the end iterator.