[PATCH] D15797: [clang-tidy] Fix readability-braces-around-statements assert failure

Alexander Kornienko via cfe-commits cfe-commits at lists.llvm.org
Wed Dec 30 01:59:14 PST 2015


alexfh added a comment.

In http://reviews.llvm.org/D15797#317793, @mattsta wrote:

> It's difficult to track down *why* the invalid locations are happening because by the time we get to an invalid location, all source location information is lost.  The best I've been able to come up with is fixing the early return conditions (which were previously impossible to reach due to asserts catching the invalid conditions first).
>
> It's easy to have these happen on any large codebase (e.g. try to recursively clang-tidy the erlang source tree with readability-braces-around-statements).


I'd still like to add a test for this (and I have a different idea on how to fix this, namely return an invalid location from `findRParenLoc` instead of asserting). If you can't come up with a test case, I'll try to find one myself by running on some files, but we absolutely have to add a test to avoid regressions when this code is changed again.


Repository:
  rL LLVM

http://reviews.llvm.org/D15797





More information about the cfe-commits mailing list