The use-case is when renaming a widely used name, like a lower-level class in a codebase and clang-rename is simply invoked for each translation unit based on the compile database. In this case it's not interesting to show errors: not finding the symbol means there is simply nothing to do.
|186 ↗||(On Diff #96320)|
Later in RenamingAction.cpp:48 we assume that the PrevNames vector is parallel to the NewNames one, but in the above case we return early, so that's not the case. An easy way to avoid violating that assumption was to keep setting the error, so we don't reach the problematic part of RenamingAction. (If we reach it, we'll crash.)
A perhaps more elegant way is to not set the flag, but instead check if the two vectors are parallel after checking for errors, I'll do that in a moment.