[PATCH] D42729: clang-format: Fix formatting of function body followed by semicolon

Daniel Jasper via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 31 05:20:05 PST 2018


djasper added a comment.

I think this case is not important enough to fix. Please tell users to just delete the useless semicolon.

In particular, my concern is that this makes the data-flow significantly more complicated. Early on in the development, we had separate token classes for the different states of the analysis (unwrapped line parsing, annotation, formatting) with const members. We had to move away from that as it didn't carry the costs that it had. However, this change changes the behavior from the BlockKind only ever being set inside the UnwrappedLineParser and being consumed later (e.g. in the TokenAnnotator) to a state where it is set in many places and setting and changing the value are inter-mingled. That makes it much harder to understand the invariants. E.g. how can we ensure that the incorrect BK_BracedInit hasn't already be consumed by something (now and in the future).


Repository:
  rC Clang

https://reviews.llvm.org/D42729





More information about the cfe-commits mailing list