id summary reporter owner description type status milestone component version severity resolution keywords cc 13217 remove_all(const path& p, system::error_code& ec) is not supposed to throw filesystem_error, but still can Brad Spencer Beman Dawes "I will be submitting a github pull request in association with this ticket. According to the documentation, uintmax_t remove_all(const path& p, system::error_code& ec) is not supposed to throw filesystem_error. However, when the directory_iterator used in the loop inside the implementation helper function remove_all_aux() is incremented, it's not done in a way that considers the ec argument. So, when incrementing the iterator fails, the operator++() on the directory_iterator throws, which leads to remove_all() incorrectly throwing. To fix this, it seems that one can take the same approach as the recent changes for Fix #7307 (commit 4e4374336c640c2717f6a1b168406e11bdf7d6f1) and replace the ++itr call in the loop with an explicit call to either directory_iterator::increment(system::error_code& ec) whenever an ec argument is in effect. This should prevent remove_all() from throwing in such cases and thus allow it to conform to its interface specification. BTW I also found these possibly related tickets in Trac: * #10380 * #12640 " Bugs new To Be Determined filesystem Boost 1.64.0 Problem