This essentially reverts e02ed1c255d71 and puts in a new fix, which makes path::iterator a true C++20 bidirectional_iterator, but downgrades it to an input_iterator in C++17.
Fixes https://github.com/llvm/llvm-project/issues/37852
However, notice that this makes *it do a copy (of a hopefully short string), rather than just returning a reference; that might have perf implications.
And notice that a for-loop like for (auto& elt : path) will no longer compile (but this is just more evidence that auto&& Always Works ;)).
On the plus side, after this patch there is no downside to using std::reverse_iterator<fs::path::iterator>... unless I've missed something.